/* ============================================================
   🌐 全局样式
   ============================================================ */

:root {
  /* CSS 变量由 layout.ts 动态注入，这里只写固定样式 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  transition: background 0.3s, color 0.3s;
}

a {
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}


/* ============================================================
   📌 顶部工具条
   ============================================================ */

.top-bar {
  background: var(--bg-secondary);
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 0;
  flex-wrap: wrap;
}

.top-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s;
}

.top-links a:hover {
  color: var(--accent);
}

.top-links .top-divider {
  color: var(--border);
  margin: 0 4px;
}

.top-links .countdown-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.top-links .countdown-text {
  font-weight: 500;
  transition: color 0.3s;
}

.top-links-right {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 0;
  flex-wrap: wrap;
}

.top-links-right a {
  text-decoration: none;
  transition: color 0.3s;
}

.top-links-right a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.top-links-right .top-divider {
  color: var(--border);
  margin: 0 4px;
}

.date-time {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}


/* ============================================================
   🏠 主头部
   ============================================================ */

.site-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(139, 90, 43, 0.3);
  margin-bottom: 15px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
  padding-left: 0;
}

.header-left .site-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.header-left .site-title a {
  text-decoration: none;
  color: #ffffff;
}

.header-left .site-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.2;
  margin-top: 4px;
}

.header-left .site-logo img {
  height: 36px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 0;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 30px;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.main-nav a.active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}


/* ============================================================
   📋 下拉菜单
   ============================================================ */

.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown > a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 30px;
  transition: all 0.3s;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
  cursor: pointer;
}

.nav-dropdown > a:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.dropdown-content {
  display: none;
  position: fixed;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  width: 1160px;
  max-width: 1160px;
  background: var(--bg-secondary); 
  border-radius: 0 0 12px 12px;
  border-width: 0 2px 2px 2px;
  border-style: solid;
  border-color: var(--border);
  padding: 10px 20px;
  box-shadow: 0 12px 30px var(--shadow-hover);
  z-index: 100;
  justify-content: center;
  gap: 4px 8px;
  flex-wrap: wrap;
  margin-top: 0;
  box-sizing: border-box;
}

.dropdown-content.show {
  display: flex;
}

.dropdown-content a {
  display: inline-block;
  padding: 4px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
  background: transparent;
}

.dropdown-content a:hover {
  background: var(--accent);
  color: #fff;
}

.dropdown-arrow {
  position: fixed;
  top: auto;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 10px solid var(--bg-secondary); 
  z-index: 101;
  pointer-events: none;
  margin-top: 0px;
  opacity: 0;
  transition: left 0.15s ease, opacity 0.15s ease;
}

.dropdown-arrow.show {
  display: block;
  opacity: 1;
}


/* ============================================================
   🍔 汉堡菜单 & 面板
   ============================================================ */

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  transition: background 0.3s;
  flex-shrink: 0;
}

.hamburger:hover {
  background: var(--bg-secondary);
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #ffffff;
  border-radius: 3px;
  transition: all 0.3s;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-overlay.show {
  display: block;
  opacity: 1;
}

.nav-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 80%;
  height: 100%;
  background: var(--bg-card);
  z-index: 1000;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px 0;
  overflow-y: auto;
  box-shadow: -4px 0 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.nav-panel.open {
  right: 0;
}

.nav-panel .panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-panel .panel-header .panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-panel .panel-header .panel-close {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border: none;
  background: none;
  transition: color 0.3s;
}

.nav-panel .panel-body {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-panel .panel-body a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-panel .panel-body a:hover,
.nav-panel .panel-body a:active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-panel .panel-body a .icon {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.nav-panel .panel-search {
  padding: 12px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.nav-panel .panel-search form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-panel .panel-search input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 30px;
  font-size: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.3s;
  min-width: 0;
}

.nav-panel .panel-search input:focus {
  border-color: var(--accent);
}

.nav-panel .panel-search button {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.3s;
  flex-shrink: 0;
}

.nav-panel .panel-search button:hover {
  background: var(--accent-hover);
}

body.nav-open {
  overflow: hidden;
}


/* ============================================================
   📄 卡片 & 布局
   ============================================================ */

.main-content {
  min-height: 60vh;
  padding: 0 0 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-hover);
}

.card-header {
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 20px;
  color: var(--accent);
  font-weight: 600;
}

.site-banner-wrapper {
  margin-bottom: 15px;
}

.site-notice {
  margin-bottom: 15px;
}

.latest-news {
  margin-bottom: 15px;
}


/* ============================================================
   🏠 首页布局
   ============================================================ */

.index-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
}


/* ============================================================
   📎 侧边栏
   ============================================================ */

.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-toggle .arrow {
  transition: transform 0.3s;
  font-size: 12px;
}

.sidebar-toggle .arrow.open {
  transform: rotate(90deg);
}

.sidebar-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.sidebar-body.open {
  max-height: 500px;
}

.sidebar-mobile-toggle {
  display: none;
  cursor: pointer;
  user-select: none;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

.sidebar-mobile-toggle .arrow {
  transition: transform 0.3s;
  font-size: 12px;
}

.sidebar-mobile-toggle .arrow.open {
  transform: rotate(90deg);
}

.sidebar-content {
  display: block;
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  width: 100%;
}

.sidebar-widget h3 {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-light);
  display: block;
  width: 100%;
}

.sidebar-widget ul {
  list-style: none;
}

.sidebar-widget li {
  margin-bottom: 6px;
}

.sidebar-widget a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.sidebar-widget a:hover {
  color: var(--accent);
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
  justify-content: center;
}

.sidebar-tags a {
  background: var(--bg-secondary);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-tags a:hover {
  background: var(--accent);
  color: #fff;
}

.sidebar-widget input[type="text"] {
  border: 2px solid var(--border) !important;
  border-radius: 30px !important;
  transition: border-color 0.3s;
}

.sidebar-widget input[type="text"]:focus {
  border-color: var(--accent) !important;
  outline: none;
}

.sidebar-widget button[type="submit"] {
  background: var(--accent) !important;
  border: none;
  border-radius: 30px;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}

.sidebar-widget button[type="submit"]:hover {
  background: var(--accent-hover) !important;
}


/* ============================================================
   🔥 热门文章
   ============================================================ */

.hot-article-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.hot-article-item:last-child {
  border-bottom: none;
}

.hot-article-item .rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.hot-article-item .rank.top1 {
  background: #FF6B35;
  color: #fff;
}

.hot-article-item .rank.top2 {
  background: #FF9F43;
  color: #fff;
}

.hot-article-item .rank.top3 {
  background: #FECA57;
  color: #333;
}

.hot-article-item .hot-title {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.hot-article-item .hot-title:hover {
  color: var(--accent);
}

.hot-article-item .hot-views {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}


/* ============================================================
   🖼️ 相册
   ============================================================ */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.album-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px var(--shadow-hover);
}

.album-cover {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: #f0f2f5;
}

.album-info {
  padding: 16px;
}

.album-title {
  font-size: 18px;
  margin-bottom: 6px;
}

.album-title a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.album-title a:hover {
  color: var(--accent);
}


/* ============================================================
   📸 照片
   ============================================================ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.photo-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-hover);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.photo-card .photo-info {
  padding: 8px 10px 10px;
  background: var(--bg-card);
}

.photo-card .photo-info .photo-caption {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.photo-card .photo-info .photo-shot-at {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}


/* ============================================================
   🖼️ 文章图集（photo-gallery）
   ============================================================ */

.photo-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  margin: 24px 0 16px !important;
}

.photo-gallery .photo-block {
  display: block !important;
  background: var(--bg-card);
  border-radius: 12px !important;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: all 0.3s ease;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  clear: none !important;
}

.photo-gallery .photo-block:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px var(--shadow-hover);
  border-color: var(--accent);
}

.photo-gallery br,
.photo-gallery p {
  display: none !important;
}

.photo-gallery .photo-img {
  position: relative;
  width: 100% !important;
  background: var(--bg-secondary);
  overflow: hidden;
  cursor: pointer;
  display: block !important;
  line-height: 0 !important;
  font-size: 0 !important;
  border-radius: 0 !important;
}

.photo-gallery .photo-img {
  padding-bottom: 0 !important;
}

.photo-gallery .photo-img img {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3 !important;
  object-fit: cover;
  display: block !important;
  transition: transform 0.4s ease;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}

.photo-gallery .photo-block:hover .photo-img img {
  transform: scale(1.03);
}

.photo-gallery .photo-block:has(.photo-caption > *) .photo-img {
  padding-bottom: 75% !important;
}

.photo-gallery .photo-block:has(.photo-caption > *) .photo-img img {
  position: absolute !important;
  height: 100% !important;
  aspect-ratio: unset !important;
}

.photo-gallery .photo-caption {
  padding: 10px 14px 12px !important;
  background: var(--bg-card);
  text-align: center !important;
}

.photo-gallery .photo-caption:not(:has(*)) {
  display: none !important;
}

.photo-gallery .photo-caption .caption-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 4px;
  text-align: center !important;
}

.photo-gallery .photo-caption .caption-time {
  font-size: 14px;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Roboto, Arial, sans-serif;
  letter-spacing: 0.3px;
  font-weight: 400;
  text-align: center !important;
}


/* ============================================================
   🔄 对比图展示（compare-grid）
   ============================================================ */

.compare-grid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 24px !important;
  margin: 24px 0 !important;
}

.compare-grid .compare-item {
  display: block !important;
  background: var(--bg-card);
  border-radius: 12px !important;
  overflow: hidden;
  border: 2px solid var(--border) !important;
  transition: all 0.3s ease;
  cursor: pointer;
}

.compare-grid .compare-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px var(--shadow-hover);
  border-color: var(--accent) !important;
}

.compare-grid .compare-item .compare-img-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 75% !important;
  overflow: hidden;
  background: none !important;
}

.compare-grid .compare-item .compare-img-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block !important;
  border-radius: 0 !important;
  transition: transform 0.4s ease;
  margin: 0 !important;
  padding: 0 !important;
}

.compare-grid .compare-item:hover .compare-img-wrap img {
  transform: scale(1.03);
}

.compare-grid .compare-item .compare-label {
  padding: 10px 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}


/* ============================================================
   📋 分页
   ============================================================ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 30px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination a:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}


/* ============================================================
   📝 文章列表
   ============================================================ */

.article-list {
  list-style: none;
}

.article-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.article-item:last-child {
  border-bottom: none;
}

.article-title {
  font-size: 20px;
  margin-bottom: 10px;
}

.article-title a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.article-title a:hover {
  color: var(--accent);
}

.article-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.article-excerpt {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 16px;
  text-align: justify;
  text-justify: inter-ideograph;
  text-indent: 2em;
}


/* ============================================================
   📎 侧边摘抄卡片
   ============================================================ */

.sidebar-quote {
  float: right;
  width: 320px;
  max-width: 100%;
  margin: 8px 0 16px 20px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
}

.sidebar-quote:hover {
  box-shadow: 0 8px 28px var(--shadow-hover);
  transform: translateY(-2px);
}

.sidebar-quote .quote-header {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 2px;
}

.sidebar-quote .quote-body {
  padding: 14px 16px;
  max-height: 395px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.sidebar-quote .quote-body::-webkit-scrollbar {
  width: 4px;
}

.sidebar-quote .quote-body::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.sidebar-quote .quote-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.sidebar-quote .quote-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.sidebar-quote .quote-body .sub-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
  margin: 12px 0 4px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent-light);
}

.sidebar-quote .quote-body .sub-title:first-child {
  margin-top: 0;
}

.sidebar-quote .quote-body p {
  text-align: justify;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.sidebar-quote .quote-body hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 10px 0;
}

.sidebar-quote.left {
  float: left;
  margin: 8px 20px 16px 0;
}


/* ============================================================
   📄 正文内容通用样式
   ============================================================ */

.page-content > p {
  text-indent: 2em;
  margin: 0.5em 0;
}

.page-content p,
.page-content li {
  text-align: justify;
  text-justify: inter-ideograph;
}

.page-content img {
  display: block;
  margin: 1em auto;
  max-width: 100%;
  height: auto;
}

.page-content-list {
  padding-left: 28px;
  margin: 0;
  max-width: 100%;
  text-align: justify;
  text-justify: inter-ideograph;
}

.page-content-list li {
  border-bottom: 1px dashed #ccc;
  padding-bottom: 6px;
  margin-bottom: 6px;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.page-content-list li:last-child {
  border-bottom: none;
}

.custom-line p {
  text-indent: 2em;
  margin: 0.5em 0;
}

.custom-line p:not([align]) {
  text-align: justify;
  text-justify: inter-ideograph;
}

.badge-private {
  display: inline-block;
  margin-left: 8px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.8;
  color: #721c24;
  background: #f8d7da;
  border-radius: 20px;
  border: 1px solid #f5c6cb;
}


/* ============================================================
   自定义行样式（虚线背景图）
   ============================================================ */

.custom-line {
    padding: 0;
    margin: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='29'%3E%3Cline x1='0' y1='27' x2='4' y2='27' stroke='%23d0d0d0' stroke-width='1' stroke-dasharray='2,2'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-position: 0 0;
    background-size: 4px 2.5em;
}

.custom-line p {
    margin: 0 !important;
    padding: 0;
    line-height: 2.5em;
    background: transparent !important;
}


/* ============================================================
   🖼️ 灯箱
   ============================================================ */

.photo-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  animation: lightboxIn 0.3s ease;
}

@keyframes lightboxIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.photo-lightbox .lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  transition: all 0.3s;
  font-family: Arial, sans-serif;
  line-height: 1;
}

.photo-lightbox .lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.photo-lightbox .lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.photo-lightbox .lightbox-img.loaded {
  opacity: 1;
}

.photo-lightbox .lightbox-loader {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox .lightbox-loader .loader-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.photo-lightbox .lightbox-info {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  padding: 10px 24px;
  border-radius: 40px;
  color: #fff;
  font-size: 14px;
  display: flex;
  gap: 20px;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  white-space: nowrap;
}

.photo-lightbox .lightbox-info.visible {
  opacity: 1;
}

.photo-lightbox .lightbox-info .info-caption {
  font-weight: 500;
}

.photo-lightbox .lightbox-info .info-time {
  opacity: 0.7;
  font-size: 13px;
}

.photo-lightbox .lightbox-toolbar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 8px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  white-space: nowrap;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.photo-lightbox .lightbox-toolbar .lb-counter {
  font-weight: 600;
  color: #fff;
}

.photo-lightbox .lightbox-toolbar .lb-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.photo-lightbox .lightbox-toolbar a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s;
}

.photo-lightbox .lightbox-toolbar a:hover {
  color: var(--accent-hover);
}

.photo-lightbox .lightbox-toolbar .divider {
  color: rgba(255, 255, 255, 0.2);
}

.photo-lightbox .lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.photo-lightbox:hover .lightbox-nav {
  opacity: 1;
}

.photo-lightbox .lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.15);
}

.photo-lightbox .lightbox-nav.prev {
  left: -60px;
}

.photo-lightbox .lightbox-nav.next {
  right: -60px;
}


/* ============================================================
   🏁 底部
   ============================================================ */

.site-footer {
  background: var(--bg-secondary);
  padding: 20px 0 24px;
  margin-top: 30px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}


/* ============================================================
   📱 响应式 - 按国际大厂标准（断点：1024px）
   ============================================================ */

/* ===== 手机（≤768px） ===== */
@media (max-width: 768px) {
  .hamburger {
    display: flex !important;
  }

  .main-nav {
    display: none !important;
  }

  .dropdown-content {
    display: none !important;
  }

  .dropdown-arrow {
    display: none !important;
  }

  /* 🔥 关键修复：改用 max-height 控制折叠，并确保 display 为 block */
  .sidebar-content {
    display: block !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .sidebar-content.open {
    max-height: 2000px;
  }

  .header-inner {
    flex-direction: column;
    text-align: center;
    flex-wrap: wrap;
    padding: 6px 0;
  }

  .header-left {
    align-items: center;
    padding-left: 0;
    width: 100%;
  }

  .header-left .site-title {
    font-size: 17px;
  }

  .header-left .site-desc {
    font-size: 10px;
    text-align: center;
    max-width: 100%;
  }

  .header-right {
    width: 100%;
    justify-content: center;
    padding-right: 0;
  }

  .top-bar-inner {
    flex-direction: row;
    justify-content: space-between;
    padding: 4px 0;
  }

  .top-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-left: 0;
  }

  .top-links a {
    font-size: 10px;
  }

  .top-links .top-divider {
    margin: 0 2px;
  }

  .top-links-right {
    font-size: 10px !important;
    gap: 4px !important;
    padding-right: 0;
  }

  .top-links-right a {
    font-size: 10px !important;
  }

  .date-time {
    font-size: 10px;
    white-space: nowrap;
  }

  .hamburger span {
    width: 22px;
    height: 2.5px;
  }

  .nav-panel {
    width: 280px;
  }

  .nav-panel .panel-body a {
    padding: 10px 16px;
    font-size: 14px;
  }

  .nav-panel .panel-search input {
    font-size: 13px;
    padding: 8px 14px;
  }

  .nav-panel .panel-search button {
    font-size: 13px;
    padding: 8px 16px;
  }

  .container {
    padding: 0 12px;
  }

  .header-left .site-desc {
    max-width: 100%;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  /* 卡片：正常间距 + 圆角 */
  .card {
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 12px;
  }

  /* 侧边栏切换按钮 */
  .sidebar-mobile-toggle {
    display: flex;
    margin-bottom: 12px;
    border-radius: 12px;
  }

  /* 🔥 网格布局：保留合适间距 */
  .index-layout {
    grid-template-columns: 1fr;
    gap: 0;  /* 改为0，用卡片和侧边栏自身的 margin 来控制间距 */
  }

  /* 🔥 关键修复：覆盖桌面端的 sticky 定位 */
  .sidebar {
    position: relative;
    top: 0;
    margin-top: 0;
  }

  /* 侧边栏小工具保留样式 */
  .sidebar-content .sidebar-widget {
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
  }

  .sidebar-content .sidebar-widget:first-child {
    padding-top: 12px;
  }

  /* ===== 手机端字体整体调整 ===== */
  .top-bar,
  .top-links a,
  .top-links-right a,
  .date-time {
    font-size: 12px !important;
  }

  .site-notice,
  .latest-news {
    font-size: 14px !important;
  }

  .article-meta,
  .sidebar-widget,
  .card p,
  .card li {
    font-size: 14px !important;
  }

  .page-content {
    font-size: 15px !important;
  }
}

/* ===== 平板（769-1024px）：完整导航，无下拉菜单 ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .hamburger {
    display: none !important;
  }

  .main-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 4px;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav a {
    padding: 4px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .dropdown-content {
    display: none !important;
  }

  .dropdown-arrow {
    display: none !important;
  }

  .header-inner {
    flex-wrap: nowrap;
  }

  .header-left .site-title {
    font-size: 18px;
  }

  .header-left .site-desc {
    font-size: 11px;
  }
}

/* ===== 桌面（>1024px）：完整导航 + 下拉菜单 ===== */
@media (min-width: 1025px) {
  .hamburger {
    display: none !important;
  }

  .main-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
  }

  .main-nav a {
    padding: 4px 10px !important;
    font-size: 16px !important;
  }

  .dropdown-content {
    display: none !important;
    width: 1160px;
    max-width: 1160px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin-top: 6px;
  }

  .dropdown-content.show {
    display: flex !important;
  }

  .dropdown-arrow {
    display: none !important;
  }

  .dropdown-arrow.show {
    display: block !important;
  }

  .header-inner {
    padding: 6px 0 !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }

  .header-left .site-title {
    font-size: 20px !important;
  }

  .header-left .site-desc {
    font-size: 12px !important;
  }

  .header-left {
    padding-left: 0 !important;
  }

  .header-right {
    padding-right: 0 !important;
  }

  .photo-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }

  .album-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
  }
}


/* ============================================================
   🧩 Flash 消息
   ============================================================ */

.flash-message {
  padding: 14px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease;
  margin-bottom: 20px;
  position: relative;
  z-index: 10;
}

.flash-message.success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.flash-message.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flash-message {
  animation: slideDown 0.3s ease, fadeOut 0.5s ease 3.5s forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    max-height: 100px;
    margin-bottom: 20px;
  }
  to {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding: 0 20px;
    overflow: hidden;
  }
}


/* ============================================================
   🎨 后台管理
   ============================================================ */

.admin-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #333;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-header h1 {
  font-size: 18px;
  color: #FFCC00;
  margin: 0;
}

.admin-header .user-info {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-header .user-info a {
  color: #FFCC00;
  text-decoration: none;
}

.admin-header .user-info a:hover {
  text-decoration: underline;
}

.admin-container {
  display: flex;
  padding-top: 56px;
  min-height: 100vh;
  background: #f5f5f5;
  width: 100%;
}

.admin-sidebar {
  width: 220px;
  min-height: calc(100vh - 56px);
  background: #2c3e50;
  color: #ecf0f1;
  flex-shrink: 0;
  padding: 8px 0 20px;
  overflow-y: auto;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
}

.admin-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-sidebar li {
  margin-bottom: 2px;
}

.admin-sidebar a {
  display: block;
  padding: 10px 20px;
  color: #bdc3c7;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}

.admin-sidebar a:hover {
  background: #34495e;
  color: #fff;
  border-left-color: #10ac84;
}

.admin-sidebar a.active {
  background: #10ac84;
  color: #fff;
  border-left-color: #fff;
}

.admin-content {
  flex: 1;
  padding: 42px 32px 20px 32px;
  background: #f5f5f5;
  min-height: calc(100vh - 56px);
  width: 100%;
  overflow-x: auto;
}

/* 后台表格容器自适应 */
.admin-content {
  overflow-x: auto;
}

.admin-content table {
  min-width: 600px;
  font-size: 14px;
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 180px;
  }

  .admin-sidebar a {
    padding: 8px 14px;
    font-size: 13px;
  }

  .admin-content {
    padding: 16px !important;
  }
}

@media (max-width: 600px) {
  .admin-container {
    flex-direction: column;
    padding-top: 50px;
  }

  .admin-sidebar {
    width: 100%;
    min-height: auto;
    height: auto;
    position: static;
    padding: 4px 0 !important;
  }

  .admin-sidebar ul {
    display: flex;
    flex-wrap: wrap;
    padding: 4px 8px;
  }

  .admin-sidebar li {
    margin: 2px;
  }

  .admin-sidebar a {
    padding: 6px 12px;
    font-size: 12px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .admin-sidebar a.active {
    border-bottom-color: #fff;
    border-left-color: transparent;
  }

  .admin-content {
    padding: 12px 8px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-content table {
    font-size: 12px;
    min-width: 580px;
  }

  .admin-content table th,
  .admin-content table td {
    padding: 6px 8px;
    white-space: nowrap;
  }

  .admin-content .btn,
  .admin-content a[style*="padding"] {
    font-size: 11px !important;
    padding: 4px 10px !important;
  }

  .admin-content table td:last-child {
    white-space: nowrap;
  }

  .admin-content table form {
    display: inline;
  }

  .admin-header {
    padding: 10px 16px !important;
    height: 50px;
  }

  .admin-header h1 {
    font-size: 15px;
  }

  .admin-header .user-info {
    font-size: 12px;
    gap: 10px;
  }
}


/* ============================================================
   🧩 工具类 & 杂项
   ============================================================ */

.message {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #10ac84;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}

.btn:hover {
  background: #0e9a74;
}

.btn-danger {
  background: #e74c3c;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-secondary {
  background: #95a5a6;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

table th {
  background: #f8f9fa;
  font-weight: bold;
}