/* ============================================================
   点集智云 - Z-BlogPHP 主题样式表
   版本: 1.0.0
   作者: 大乌
   ============================================================ */

/* === CSS Variables === */
:root {
  --primary: #1e90ff;
  --primary-light: rgba(30, 144, 255, 0.1);
  --primary-dark: #1a7fd4;
  --bg: #f5f7fa;
  --bg-card: #ffffff;
  --bg-nav: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.3s ease;
  --container-width: 1200px;
  --sidebar-width: 300px;
  --nav-height: 60px;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-nav: #0f3460;
  --text: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted: #808080;
  --border: #2a2a4a;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.4);
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: var(--transition);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* === Navigation === */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-nav);
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo .logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.logo-before {
  color: var(--text);
}

.logo-after {
  color: var(--primary);
}

.logo-img {
  height: 36px;
  max-width: 180px;
}

.nav-menu {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-list li a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  z-index: 100;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu li a {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 0;
}

.dropdown-menu li:first-child a {
  border-radius: var(--radius) var(--radius) 0 0;
}

.dropdown-menu li:last-child a {
  border-radius: 0 0 var(--radius) var(--radius);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-toggle,
.darkmode-toggle,
.mobile-menu-toggle {
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
  border-radius: 50%;
  transition: var(--transition);
  user-select: none;
}

.search-toggle:hover,
.darkmode-toggle:hover {
  background: var(--primary-light);
}

.mobile-menu-toggle {
  display: none;
  font-size: 22px;
}

.search-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 0;
}

.search-bar form {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}

.search-btn {
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--primary-dark);
}

/* === Top Ad === */
.ad-top {
  background: var(--bg-card);
  text-align: center;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.ad-header-banner {
  padding: 12px 0;
  text-align: center;
}

/* === Main Layout === */
.site-main {
  display: flex;
  gap: 24px;
  padding: 24px 20px;
}

.content-area {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* === Recommend Section === */
.recommend-section {
  margin-bottom: 24px;
}

.section-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-icon {
  font-size: 20px;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
/* When recommend is full-width, show 3 cards per row */
.content-area.full-width-mode .recommend-grid {
  grid-template-columns: repeat(3, 1fr);
}
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.recommend-card {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
}

.recommend-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.recommend-cover {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: var(--border);
}

.recommend-info {
  padding: 12px;
}

.recommend-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommend-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.recommend-rating {
  color: #ffa500;
}

/* === Tab Section === */
.tab-section {
  margin-bottom: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tab-nav::-webkit-scrollbar {
  height: 4px;
}

.tab-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.tab-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 24px;
}
/* When tab is two-column (not full-width), use single column */
.content-area:not(.full-width-mode) .tab-article-list {
  grid-template-columns: 1fr;
}
.tab-article-list {
  list-style: none;
}

.tab-article-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.tab-article-item:last-child {
  border-bottom: none;
}

.tab-index {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px;
  margin-right: 12px;
  flex-shrink: 0;
}

.tab-article-item:nth-child(-n+3) .tab-index {
  background: var(--primary);
  color: #fff;
}

.tab-article-title {
  flex: 1;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-article-title:hover {
  color: var(--primary);
}

.tab-article-date {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 12px;
  flex-shrink: 0;
}

/* === Section Blocks === */
.section-block {
  margin-bottom: 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.section-article {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.section-article:last-child {
  border-bottom: none;
}

.section-article-cover {
  width: 180px;
  height: 120px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.section-article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.section-article:hover .section-article-cover img {
  transform: scale(1.05);
}

.section-article-info {
  flex: 1;
  min-width: 0;
}

.section-article-info h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.section-article-info h3 a {
  color: var(--text);
}

.section-article-info h3 a:hover {
  color: var(--primary);
}

.section-article-intro {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.section-article-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* mode-right: 右图左文 */
.mode-right {
  flex-direction: row-reverse;
}

/* mode-plain: 双列纯文字 */
.section-plain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.plain-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.plain-index {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  margin-right: 10px;
  flex-shrink: 0;
}

.plain-item:nth-child(-n+3) .plain-index {
  background: var(--primary);
  color: #fff;
}

.plain-title {
  flex: 1;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plain-date {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 8px;
  flex-shrink: 0;
}

/* mode-gallery: 纯图片网格 */
.section-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.gallery-item {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--border);
}

.gallery-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: var(--transition);
}

.gallery-item:hover .gallery-cover {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #fff;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-title {
  font-size: 13px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-date {
  font-size: 12px;
  opacity: 0.8;
}

/* === Article Cards (List) === */

.article-card {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.article-cover {
  width: 220px;
  height: 160px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background: var(--border);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.article-card:hover .article-cover img {
  transform: scale(1.05);
}

.article-rating-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #ffa500;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.istop-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.article-content {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.article-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.article-title a {
  color: var(--text);
}

.article-title a:hover {
  color: var(--primary);
}

.article-intro {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.meta-category {
  color: var(--primary);
  font-weight: 500;
}

.meta-rating {
  color: #ffa500;
}

/* === Article Detail Page === */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 12px 0;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.article-header {
  margin-bottom: 20px;
}

.article-title-full {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text);
}

.article-meta-full {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow-x: auto;
}

.meta-rating-full {
  color: #ffa500;
}

.share-link {
  color: var(--primary);
  cursor: pointer;
}

.share-link:hover {
  text-decoration: underline;
}

/* Article Body + TOC */
















.toc-body a:hover,


.article-body-wrapper {
  position: relative;
  min-height: 40px;
}

.article-body {
  position: relative;
  flex: 1;
  min-width: 0;
  min-width: 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.article-body h2 {
  font-size: 22px;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.article-body h3 {
  font-size: 18px;
  margin: 20px 0 10px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body img {
  border-radius: var(--radius);
  margin: 12px 0;
}

.article-body pre {
  background: #f4f4f4;
  padding: 10px 12px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 12px 0;
}

[data-theme="dark"] .article-body pre {
  background: #0d1117;
}

.article-body code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}

[data-theme="dark"] .article-body code {
  background: #2d2d3d;
}

.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  margin: 12px 0;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.article-body th {
  background: var(--primary-light);
  font-weight: 600;
}

/* === Download Module === */
.download-module {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0;
}

.download-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.download-title {
  font-size: 16px;
  color: var(--primary);
}

.download-version {
  font-size: 13px;
  color: var(--text-muted);
}

.download-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.download-item:last-child {
  border-bottom: none;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.download-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
}

.download-icon {
  font-size: 18px;
}

.download-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.info-tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
}

.info-pwd {
  color: var(--text-secondary);
}

.info-pwd code {
  background: #fff3cd;
  color: #856404;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
}

[data-theme="dark"] .info-pwd code {
  background: #3d3520;
  color: #ffc107;
}

/* Cloud download button (inline replacement) */
.cloud-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 13px;
  margin: 4px 0;
  transition: var(--transition);
}

.cloud-download-btn:hover {
  background: var(--primary);
  color: #fff;
}

.cloud-pwd {
  font-size: 12px;
  color: #856404;
  margin-left: 4px;
}

/* === Star Rating === */
.star-rating {
  color: #ffa500;
  font-size: 14px;
  letter-spacing: 1px;
}

.rating-num {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* === Article Tags === */
.article-tags {
  padding: 10px 12px 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tags-label {
  font-size: 13px;
  color: var(--text-muted);
}

.tag-item {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 12px;
  transition: var(--transition);
}

.tag-item:hover {
  background: var(--primary);
  color: #fff;
}

/* === Related Articles === */
.related-section {
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.related-title {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.related-card {
  display: block;
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.related-cover {
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: var(--border);
}

.related-name {
  font-size: 13px;
  padding: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-date {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 8px 8px;
  display: block;
}

/* === Article Nav (Prev/Next) === */
.article-nav {
  display: flex;
  justify-content: space-between;
  margin: 24px 0;
  gap: 16px;
}

.nav-prev,
.nav-next {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-prev:hover,
.nav-next:hover {
  color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.nav-next {
  text-align: right;
}

/* === Comments === */
.comments-section {
  margin: 24px 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.comments-title {
  font-size: 16px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.comment-item:last-of-type {
  border-bottom: none;
}

.comment-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.comment-body {
  flex: 1;
}

.comment-header {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: 14px;
}

.comment-date {
  font-size: 12px;
  color: var(--text-muted);
}

.comment-content {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 6px;
}

.comment-actions {
  font-size: 12px;
}

.comment-reply {
  color: var(--text-muted);
}

.comment-reply:hover {
  color: var(--primary);
}

.no-comments {
  text-align: center;
  color: var(--text-muted);
  padding: 20px 0;
}

/* Comment Form */
.comment-form-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.comment-form-title {
  font-size: 15px;
  margin-bottom: 12px;
}

.form-row {
  margin-bottom: 12px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-submit {
  padding: 10px 30px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.comment-submit:hover {
  background: var(--primary-dark);
}

.logged-in {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.page-link {
  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: var(--radius);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
}

.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-link.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-link.ellipsis {
  border: none;
  background: transparent;
}

/* === Sidebar === */
.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ranking Widget */
.ranking-list {
  list-style: none;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-num {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 3px;
  flex-shrink: 0;
}

.ranking-num.ranking-top {
  background: var(--primary);
  color: #fff;
}

.ranking-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.ranking-title:hover {
  color: var(--primary);
}

.ranking-view {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Categories Widget */
.cate-list {
  list-style: none;
}

.cate-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.cate-item:last-child {
  border-bottom: none;
}

.cate-item a {
  color: var(--text);
  font-size: 14px;
}

.cate-item a:hover {
  color: var(--primary);
}

.cate-count {
  font-size: 12px;
  color: var(--text-muted);
}

/* Tag Cloud Widget */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-cloud-item {
  display: inline-block;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  transition: var(--transition);
}

.tag-cloud-item:hover {
  background: var(--primary);
  color: #fff;
}

/* Latest Widget */
.latest-list {
  list-style: none;
}

.latest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.latest-item:last-child {
  border-bottom: none;
}

.latest-item a {
  flex: 1;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-item a:hover {
  color: var(--primary);
}

.latest-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
  flex-shrink: 0;
}

/* Sidebar Ad */
.sidebar-ad {
  text-align: center;
  padding: 8px;
}

/* === Footer === */
.site-footer {
  background: var(--bg-nav, #ffffff);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 40px 0 20px;
}
.site-footer:not([data-theme="dark"]) {
  background: #ffffff !important;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 24px;
}

.footer-col h3 {
  font-size: 15px;
  margin-bottom: 12px;
  color: var(--text);
}

.footer-col p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.footer-links {
  list-style: none;
}

.footer-links li a {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 4px 0;
  display: block;
}

.footer-links li a:hover {
  color: var(--primary);
}

.footer-ad {
  text-align: center;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.copyright {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.powered {
  font-size: 12px;
  color: var(--text-muted);
}

.powered a {
  color: var(--text-muted);
}

.powered a:hover {
  color: var(--primary);
}

/* === Page Content === */
.page-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.page-title {
  font-size: 24px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
}

.page-body {
  font-size: 15px;
  line-height: 1.8;
}

/* === 404 Page === */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.error-content {
  text-align: center;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
  opacity: 0.3;
}

.error-message {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.error-home-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 15px;
  transition: var(--transition);
}

.error-home-btn:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* === Search Results === */
.search-result-header {
  margin-bottom: 20px;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.search-result-header h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.search-result-header p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Category Header */
.category-header {
  margin-bottom: 20px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.category-title {
  font-size: 22px;
  margin-bottom: 8px;
}

.category-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* === Share Modal === */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  position: relative;
}

.share-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.share-options {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.share-btn {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

.share-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.poster-styles {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.poster-style {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}

.poster-style:hover {
  border-color: var(--primary);
}

/* === Category Header on List === */
.category-header {
  margin-bottom: 20px;
}

.category-header h1 {
  font-size: 22px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

/* === Article List for non-index === */

/* === Responsive Design === */

/* Responsive tables */
.article-body table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;}
.article-body td,.article-body th{min-width:80px;}
@media (max-width: 1024px) {
  .site-main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .recommend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
/* When recommend is full-width, show 3 cards per row */
.content-area.full-width-mode .recommend-grid {
  grid-template-columns: repeat(3, 1fr);
}
.recommend-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  

  .article-body-wrapper {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 52px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 999;
  }

  .nav-menu.show {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    padding: 8px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .recommend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
/* When recommend is full-width, show 3 cards per row */
.content-area.full-width-mode .recommend-grid {
  grid-template-columns: repeat(3, 1fr);
}
.recommend-grid {
    grid-template-columns: 1fr;
  }

  .section-plain-grid {
    grid-template-columns: 1fr;
  }

  .article-card {
    flex-direction: column;
  }

  .article-cover {
    width: 100%;
    height: 200px;
  }

  .section-article {
    flex-direction: column;
  }

  .section-article-cover {
    width: 100%;
    height: 180px;
  }

  .mode-right {
    flex-direction: column;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .article-title-full {
    font-size: 20px;
  }

  .article-meta-full {
    gap: 4px;
    font-size: 12px;
    flex-wrap: nowrap;
  }

  .article-nav {
    flex-direction: column;
  }

  .section-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .download-item {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 0 12px;
  }

  .container {
    padding: 0 12px;
  }

  .recommend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
/* When recommend is full-width, show 3 cards per row */
.content-area.full-width-mode .recommend-grid {
  grid-template-columns: repeat(3, 1fr);
}
.recommend-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .section-gallery-grid {
    grid-template-columns: 1fr;
  }

  .search-bar form {
    flex-direction: column;
  }
}

/* === Print Styles === */
@media print {
  .main-nav,
  .sidebar,
  .ad-top,
  .ad-header-banner,
  .ad-article-top,
  .ad-article-bottom,
  .download-module,
  .comments-section,
  .article-nav,
  .related-section,
  .share-modal,
  .toc-sidebar,
  .site-footer {
    display: none !important;
  }

  .site-main {
    display: block;
  }

  .article-body {
    font-size: 12pt;
  }
}

/* === Download Box & Cards === */
.download-box {
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 20px 0;
}
.download-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.download-box-title {
  font-size: 16px;
  color: var(--primary);
  margin: 0;
}
.download-box-version {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: 12px;
}
.download-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.download-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.download-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.download-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.download-card-icon {
  font-size: 24px;
}
.download-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.download-card-body {
  flex: 1;
  margin-bottom: 12px;
}
.download-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.dc-meta {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.download-card-pwd {
  font-size: 13px;
  color: #856404;
  margin-top: 6px;
}
.download-card-pwd code {
  background: #fff3cd;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: monospace;
  user-select: all;
}
[data-theme="dark"] .download-card-pwd code {
  background: #3d3520;
  color: #ffc107;
}
.download-card-btn {
  display: block;
  text-align: center;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.download-card-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
}
/* === Cloud download inline button === */
.cloud-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font-size: 13px;
  margin: 4px 0;
  transition: var(--transition);
  text-decoration: none;
}
.cloud-download-btn:hover {
  background: var(--primary);
  color: #fff;
}
.cloud-pwd {
  font-size: 12px;
  color: #856404;
  margin-left: 4px;
}
@media (max-width: 900px) {
  .download-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .download-card-grid { grid-template-columns: 1fr; }
}



/* === Tab Display Modes === */
.tab-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tab-card {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.tab-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.tab-card.mode-right {
  flex-direction: row-reverse;
}
.tab-card-cover {
  width: 200px;
  min-height: 140px;
  flex-shrink: 0;
  overflow: hidden;
}
.tab-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.tab-card:hover .tab-card-cover img {
  transform: scale(1.05);
}
.tab-card-info {
  flex: 1;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.tab-card-info h3 {
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.4;
}
.tab-card-info h3 a {
  color: var(--text);
}
.tab-card-info h3 a:hover {
  color: var(--primary);
}
.tab-card-intro {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tab-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Tab Gallery Mode */
.tab-gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.tab-gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
  display: block;
}
.tab-gallery-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform .3s;
}
.tab-gallery-item:hover .tab-gallery-cover {
  transform: scale(1.08);
}
.tab-gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
}
.tab-gallery-overlay h4 {
  font-size: 13px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tab-gallery-overlay span {
  font-size: 12px;
  opacity: 0.8;
}

/* Responsive Tab Cards */
@media (max-width: 768px) {
  .tab-card {
    flex-direction: column !important;
  }
  .tab-card.mode-right {
    flex-direction: column !important;
  }
  .tab-card-cover {
    width: 100%;
    height: 160px;
  }
  .tab-gallery-list {
    grid-template-columns: repeat(2, 1fr);
  }
}



/* === Pagination Modes === */
.loadmore-wrap {
  text-align: center;
  padding: 30px 0;
}
.loadmore-btn {
  display: inline-block;
  padding: 12px 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 2px 8px rgba(30,144,255,0.3);
}
.loadmore-btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(30,144,255,0.4);
  transform: translateY(-2px);
}
.loadmore-btn:active {
  transform: translateY(0);
}
.loadmore-end {
  display: inline-block;
  padding: 12px 36px;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
}

/* Infinite Scroll */
.infinite-wrap {
  padding: 20px 0;
}
.infinite-spinner {
  text-align: center;
  padding: 20px 0;
}
.spinner-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin: 0 4px;
  animation: spinnerBounce 1.4s infinite ease-in-out both;
}
.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }
.spinner-text {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
@keyframes spinnerBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Pagination (fixed) */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 24px 0;
  flex-wrap: wrap;
}
.page-link {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  transition: all .2s;
  background: var(--bg-card);
}
.page-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.page-link.current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}
.page-link.prev, .page-link.next {
  font-weight: 500;
  padding: 8px 18px;
}
.page-link.ellipsis {
  border: none;
  background: transparent;
  cursor: default;
  color: var(--text-muted);
}



/* === Sidebar Module Styles === */
.widget-module .widget-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget-module .widget-content ul li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.widget-module .widget-content ul li:last-child {
  border-bottom: none;
}
.widget-module .widget-content ul li a {
  color: var(--text);
  transition: color .2s;
}
.widget-module .widget-content ul li a:hover {
  color: var(--primary);
}
.widget-module .widget-content table {
  width: 100%;
  border-collapse: collapse;
}
.widget-module .widget-content table td,
.widget-module .widget-content table th {
  padding: 4px;
  text-align: center;
  font-size: 12px;
}
.widget-module .widget-content table caption {
  font-weight: 600;
  padding: 8px 0;
  font-size: 14px;
}
.widget-module .widget-content .cp-hello {
  display: block;
  padding: 4px 0;
  font-size: 14px;
}
.widget-module .widget-content .cp-login a,
.widget-module .widget-content .cp-vrs a {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: 13px;
  margin: 4px 4px 4px 0;
  text-decoration: none;
}
.widget-module .widget-content form input[type="text"] {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 70%;
  font-size: 14px;
}
.widget-module .widget-content form input[type="submit"] {
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.widget-ad {
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: var(--radius);
}
.widget-ad img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}



/* === Edit Button === */
.meta-edit {
  margin-left: 8px;
}
.edit-link {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  transition: all .2s;
  opacity: 0.85;
}
.edit-link:hover {
  opacity: 1;
  background: var(--primary-dark);
  color: #fff;
}





/* === Share Bar - Right Aligned === */
.article-share-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0;
  margin-bottom: 16px;
}
.share-link-btn {
  display: inline-block;
  padding: 6px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s;
}
.share-link-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}


.meta-share { }






/* === Sort Buttons in Tab Section Header === */
.tab-section .section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tab-section .sort-btns {
  display: flex;
  gap: 4px;
}
.tab-section .sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.tab-section .sort-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.tab-section .sort-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .tab-section .sort-btn { border-color: rgba(255,255,255,0.1); }

/* === Recommend Mode Switcher === */
.recommend-mode-switcher {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.mode-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.mode-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.mode-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
[data-theme="dark"] .mode-btn {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .mode-btn:hover {
  background: rgba(30,144,255,0.15);
}
[data-theme="dark"] .mode-btn.active {
  background: var(--primary);
}
.recommend-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* === Mobile Bottom Nav === */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 1000;
  padding: 8px 0;
}
.mobile-bottom-nav.show {
  display: none !important;
}
@media (max-width: 768px) {
  .mobile-bottom-nav.show {
    display: flex !important;
    justify-content: space-around;
    align-items: center;
  }
}

/* === Quick Edit Overlay === */
.quick-edit-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
.quick-edit-overlay.show {
  display: flex;
}







/* === Z-Blog Built-in Sidebar Modules === */
/* Style built-in modules to match theme design */
.sidebar-widget.widget-module {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
}
.sidebar-widget.widget-module .widget-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}
.sidebar-widget.widget-module .widget-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
/* Category list */
.sidebar-widget.widget-module .widget-content li {
  list-style: none;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-widget.widget-module .widget-content li:last-child {
  border-bottom: none;
}
.sidebar-widget.widget-module .widget-content li a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-widget.widget-module .widget-content li a:hover {
  color: var(--primary);
}
/* Comments list */
#divComments .widget-content li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
#divComments .widget-content li a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
/* Control panel */
#divContorPanel .widget-content {
  line-height: 2;
}
#divContorPanel .widget-content .cp-hello {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 4px;
}
#divContorPanel .widget-content .cp-login,
#divContorPanel .widget-content .cp-vrs {
  display: inline-block;
  margin-right: 8px;
}
#divContorPanel .widget-content .cp-login a,
#divContorPanel .widget-content .cp-vrs a {
  color: #fff !important;
  font-size: 13px;
  padding: 4px 12px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-block;
  margin: 2px 4px 2px 0;
  transition: all 0.2s;
}
#divContorPanel .widget-content .cp-login a:hover,
#divContorPanel .widget-content .cp-vrs a:hover {
  opacity: 0.85;
  color: #fff !important;
}
/* Search form */
#divSearchPanel .widget-content form {
  display: flex;
  gap: 8px;
}
#divSearchPanel .widget-content form input[type="text"] {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}
#divSearchPanel .widget-content form input[type="submit"] {
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
/* Calendar */
#divCalendar .widget-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#divCalendar .widget-content table caption {
  padding: 8px 0;
  font-weight: 600;
  color: var(--text);
}
#divCalendar .widget-content table th {
  padding: 4px;
  color: var(--text-muted);
  font-weight: normal;
}
#divCalendar .widget-content table td {
  padding: 4px;
  text-align: center;
}
#divCalendar .widget-content table td a {
  color: var(--primary);
  font-weight: 600;
}
/* Archives */
#divArchives .widget-content li a {
  color: var(--text);
}
#divArchives .widget-content li a:hover {
  color: var(--primary);
}

/* Fix Z-Blog built-in comment module overflow */
#divComments .widget-content li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  display: block;
}
#divComments .widget-content li a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Force sidebar to display properly */
.sidebar {
  display: block !important;
  overflow: hidden;
}
.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}
.sidebar-widget {
  overflow: hidden;
  word-break: break-all;
}

/* Latest Comments Widget */
.widget-latest-comments .ranking-item {
  align-items: flex-start;
}
.widget-latest-comments .ranking-num {
  width: auto;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.widget-latest-comments .ranking-title {
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  word-break: break-all;
}

/* === Fullwidth Layout === */
.site-main.full-width-layout {
  display: block !important;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 24px 20px;
}
.site-main.full-width-layout .fullwidth-bottom-row {
  display: flex !important;
  width: 100%;
}
.fullwidth-bottom-row {
  display: flex;
  gap: 24px;
  width: 100%;
}
.fullwidth-bottom-content {
  flex: 1;
  min-width: 0;
}
.fullwidth-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* === Sidebar Layout Fix === */
.site-main {
  display: flex;
  gap: 24px;
  padding: 24px 20px;
}
.content-area {
  flex: 1;
  min-width: 0;
}
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}
@media (max-width: 960px) {
  .site-main {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .mobile-bottom-nav.show {
    display: flex !important;
    justify-content: space-around;
  }
}

/* === Recommend Display Modes === */

/* Plain2 - Two column list */
.recommend-plain2-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}
.plain2-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.plain2-item:hover { background: var(--primary-light); }
.plain2-title {
  flex: 1;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plain2-title:hover { color: var(--primary); }
.plain2-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Gallery Scroll - Two row horizontal scroll */
.gallery-scroll-wrap {
  overflow: hidden;
  position: relative;
}
.gallery-scroll-track {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gallery-scroll-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.gallery-scroll-row::-webkit-scrollbar { height: 4px; }
.gallery-scroll-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.gallery-scroll-item {
  flex: 0 0 200px;
  height: 120px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  text-decoration: none;
}
.gallery-scroll-item .gallery-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s;
}
.gallery-scroll-item:hover .gallery-cover { transform: scale(1.05); }
.gallery-scroll-item .gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
}
.gallery-scroll-item .gallery-title {
  font-size: 12px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-scroll-item .gallery-date {
  font-size: 10px;
  opacity: 0.8;
}

/* Gallery Tile */
.section-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.section-gallery-grid .gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 140px;
  text-decoration: none;
  display: block;
}
.section-gallery-grid .gallery-cover {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s;
}
.section-gallery-grid .gallery-item:hover .gallery-cover { transform: scale(1.05); }
.section-gallery-grid .gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
}
.section-gallery-grid .gallery-title {
  font-size: 12px;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-gallery-grid .gallery-date {
  font-size: 10px;
  opacity: 0.8;
}

/* Gallery Masonry */
.gallery-masonry-wrap {
  column-count: 3;
  column-gap: 8px;
}
.gallery-masonry-item {
  break-inside: avoid;
  margin-bottom: 8px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  text-decoration: none;
  display: block;
}
.gallery-masonry-item .gallery-cover img {
  width: 100%;
  display: block;
}
.gallery-masonry-item .gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
}
.gallery-masonry-item .gallery-title {
  font-size: 12px;
  margin: 0;
}

/* Plain list */
.recommend-plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plain-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.plain-item:hover { background: var(--primary-light); }
.plain-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.plain-title {
  flex: 1;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plain-title:hover { color: var(--primary); }
.plain-rating { font-size: 12px; }
.plain-views {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Mode switcher */
.recommend-mode-switcher {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.mode-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.mode-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.mode-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}
[data-theme="dark"] .mode-btn {
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .mode-btn:hover {
  background: rgba(30,144,255,0.15);
}
.recommend-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* === User Center === */
.user-center { margin: 24px 0; }
.user-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}
.user-info h2 { margin: 0 0 4px; font-size: 20px; }
.user-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.user-stats strong { color: var(--text); }
.user-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.section-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.section-card h3 {
  font-size: 16px;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.user-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { opacity: 0.9; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.djzy-level-progress {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}
.djzy-level-progress .progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s;
}
.progress-text { font-size: 12px; color: var(--text-muted); }
.level-rules { margin-top: 16px; }
.level-rules h4 { font-size: 14px; margin-bottom: 8px; }
.level-rules ul { list-style: none; padding: 0; }
.level-rules li { padding: 4px 0; font-size: 13px; color: var(--text-secondary); }
.points-rules { list-style: none; padding: 0; }
.points-rules li { padding: 6px 0; font-size: 13px; color: var(--text-secondary); }
.user-article-list { list-style: none; padding: 0; }
.user-article-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  font-size: 13px;
}
.user-article-list a { color: var(--text); text-decoration: none; flex: 1; }
.user-article-list a:hover { color: var(--primary); }
.article-status { font-size: 11px; white-space: nowrap; }
.article-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.empty-tip { text-align: center; color: var(--text-muted); padding: 20px; }
.fav-article-list { list-style: none; padding: 0; margin: 0; max-height: 300px; overflow-y: auto; }
.fav-article-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fav-article-list a { color: var(--text); text-decoration: none; font-size: 13px; flex: 1; }
.fav-article-list a:hover { color: var(--primary); }
.fav-meta { font-size: 11px; color: var(--text-muted); }
.auth-container { max-width: 420px; margin: 60px auto; }
.auth-card { background: var(--bg-card); border-radius: 16px; padding: 40px; box-shadow: var(--shadow); }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header h1 { font-size: 24px; margin-bottom: 8px; }
.auth-header p { color: var(--text-secondary); }
.auth-form .form-group { margin-bottom: 20px; }
.auth-form label { display: block; font-size: 14px; margin-bottom: 6px; }
.auth-form input, .auth-form select, .auth-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
}
.auth-form input:focus { border-color: var(--primary); outline: none; }
.btn-block { width: 100%; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-links a { color: var(--primary); }
.auth-msg { margin-top: 12px; font-size: 13px; text-align: center; }
.auth-msg.success { color: #27ae60; }
.auth-msg.error { color: #e74c3c; }
.submit-container { max-width: 800px; margin: 30px auto; background: var(--bg-card); border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow); }
.submit-container h1 { font-size: 24px; text-align: center; margin-bottom: 24px; }
.submit-form .form-group { margin-bottom: 20px; }
.submit-form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.submit-form input, .submit-form select, .submit-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
}
.submit-form textarea { resize: vertical; min-height: 100px; }
.download-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; background: var(--bg); }
.dg-row { display: flex; gap: 8px; margin-bottom: 8px; }
.dg-row:last-child { margin-bottom: 0; }
.dg-link { flex: 3; }
.dg-pwd { flex: 1; }
.dg-meta input { flex: 1; min-width: 0; }
.download-group input { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); font-size: 13px; box-sizing: border-box; }
@media (max-width: 768px) {
  .user-card { flex-direction: column; text-align: center; }
  .user-stats { justify-content: center; }
  .user-sections { grid-template-columns: 1fr; }
}
[data-theme="dark"] .user-card, [data-theme="dark"] .section-card { background: var(--bg-card); }

/* === User Action Buttons with Colors === */
.user-actions .btn-accent {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.user-actions .btn-accent:hover { background: #059669; }
.user-actions .btn-secondary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.user-actions .btn-secondary:hover { opacity: 0.9; }
.user-actions .btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.user-actions .btn-outline:hover { background: var(--primary-light); border-color: var(--primary); }

/* === Like Button === */
.like-wrapper {
  display: inline-flex;
  align-items: center;
}
.like-btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  transition: color .2s;
  white-space: nowrap;
}
.like-btn:hover { color: #ff6b6b; }
.like-btn.liked { color: #ff4757; font-weight: 600; }
.like-btn .like-heart { font-size: 15px; }
.like-btn .like-count { font-weight: 600; }

/* === Favorite Button === */
.fav-btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  transition: color .2s;
  text-decoration: none;
  white-space: nowrap;
}
.fav-btn:hover { color: #ffd700; }
.fav-btn.favorited { color: #ff8c00; font-weight: 600; }

/* === Quick Edit Button === */
.quick-edit-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
}
.quick-edit-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(30,144,255,0.06);
}



/* === Inline TOC Float Mode === */
.toc-float-btn {
  position: sticky;
  left: 0;
  top: calc(var(--nav-height) + 10px);
  z-index: 100;
  background: var(--primary);
  border: none;
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 14px;
  color: #fff;
  width: fit-content;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all .2s;
  white-space: nowrap;
}
.toc-float-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.toc-float-hint {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.85);
  margin-left: 4px;
}
.toc-float-panel {
  position: sticky;
  left: 0;
  top: calc(var(--nav-height) + 50px);
  margin-top: 4px;
  width: 260px;
  max-height: calc(100vh - var(--nav-height) - 80px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.toc-float-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toc-float-close {
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  padding: 0 4px;
}
.toc-float-close:hover {
  color: var(--primary);
}
.toc-float-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.toc-float-list ul ul {
  padding-left: 16px;
}
.toc-float-list li {
  margin-bottom: 2px;
}
.toc-float-list a {
  display: block;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 4px;
  text-decoration: none;
  transition: all .2s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.toc-float-list a:hover,
.toc-float-list a.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* === Slider / 轮播图 === */
.slider-section {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
}
.slider-section.slider-side-mode {
    display: flex;
    gap: 16px;
    background: transparent;
}
.slider-section.slider-side-mode .slider-wrap {
    flex: 1;
    min-width: 0;
}
.slider-section.slider-side-mode .slider-side-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    padding: 16px;
    overflow-y: auto;
    max-height: 400px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.slider-wrap {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 33.33%;
    overflow: hidden;
    border-radius: 12px;
    background: #1a1a2e;
}
.slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease;
    display: block;
    text-decoration: none;
}
.slider-item.active {
    opacity: 1;
    z-index: 1;
}
.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    z-index: 2;
}
.slider-dots {
    position: absolute;
    bottom: 16px;
    right: 24px;
    display: flex;
    gap: 8px;
    z-index: 3;
}
.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}
.slider-dot.active {
    background: #fff;
    transform: scale(1.2);
}
.slider-prev,
.slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    width: 40px;
    height: 60px;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.slider-section:hover .slider-prev,
.slider-section:hover .slider-next {
    opacity: 1;
}
.slider-prev {
    left: 8px;
}
.slider-next {
    right: 8px;
}
.slider-prev:hover,
.slider-next:hover {
    background: rgba(0,0,0,0.6);
}

/* Slider Responsive */
@media (max-width: 768px) {
    .slider-wrap {
        padding-bottom: 50%;
    }
    .slider-caption {
        font-size: 15px;
        padding: 30px 14px 14px;
    }
    .slider-section.slider-side-mode {
        flex-direction: column;
    }
    .slider-section.slider-side-mode .slider-side-panel {
        width: 100%;
    }
    .slider-prev,
    .slider-next {
        width: 32px;
        height: 44px;
        font-size: 18px;
        opacity: 1;
    }
}

/* === Image Lightbox / 图片灯箱 === */
.img-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
}
.lightbox-img {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    z-index: 1;
    border-radius: 4px;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 32px;
    width: 48px;
    height: 64px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: 4px;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}

/* === Latest Articles Section / 最新文章板块 === */
.latest-section { margin-bottom: 24px; }

/* Card List */
.article-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 768px) { .article-list { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.article-card { background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); display: flex; flex-direction: column; }
.article-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.article-cover { position: relative; width: 100%; padding-bottom: 62%; overflow: hidden; }
.article-cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.article-card:hover .article-cover img { transform: scale(1.05); }
.article-list .article-content { padding: 10px; flex: 1; display: flex; flex-direction: column; justify-content: flex-start; min-width: 0; }
.article-list .article-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; line-height: 1.35; }
.article-title a { color: var(--text); text-decoration: none; }
.article-title a:hover { color: var(--primary); }
.article-list .article-intro { font-size: 12px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 8px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.article-category { background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: 11px; }

/* Timeline */
.timeline-list { position: relative; padding-left: 24px; }
.timeline-list::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot { position: absolute; left: -20px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--bg-card); box-shadow: 0 0 0 2px var(--primary-light); }
.timeline-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); transition: var(--transition); }
.timeline-card:hover { box-shadow: var(--shadow-hover); }
.timeline-header { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-muted); margin-bottom: 10px; flex-wrap: wrap; }
.timeline-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.timeline-title a { color: var(--text); text-decoration: none; }
.timeline-title a:hover { color: var(--primary); }
.timeline-content { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.timeline-cover { margin-bottom: 12px; border-radius: var(--radius); overflow: hidden; }
.timeline-cover img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.timeline-footer { display: flex; align-items: center; justify-content: space-between; }
.timeline-link { font-size: 13px; color: var(--primary); font-weight: 500; }

/* Simple List */
.latest-list { display: flex; flex-direction: column; gap: 12px; }
.latest-item { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); transition: var(--transition); }
.latest-item:last-child { border-bottom: none; }
.latest-item:hover { box-shadow: var(--shadow-hover); }
.latest-item a { flex: 1; color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.latest-item a:hover { color: var(--primary); }
.latest-date { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

/* Load More */
.loadmore-wrap { text-align: center; margin-top: 24px; }
.loadmore-btn { display: inline-block; padding: 10px 32px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; cursor: pointer; transition: var(--transition); }
.loadmore-btn:hover { background: var(--primary-dark); }
.loadmore-btn:active { transform: scale(0.98); }
.loadmore-end { color: var(--text-muted); font-size: 13px; }
.infinite-wrap { text-align: center; padding: 20px 0; }
.infinite-spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spinnerRotate 0.8s linear infinite; }
@keyframes spinnerRotate { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
    .timeline-header { gap: 8px; }
    .timeline-title { font-size: 16px; }
}

/* === Simple List Mode (简洁列表) === */
.simple-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.simple-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  transition: background 0.2s;
}
.simple-item:last-child { border-bottom: none; }
.simple-item:hover { background: var(--bg-card, #f9fafb); }
.simple-date {
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
  white-space: nowrap;
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}
.simple-title {
  flex: 1;
  color: var(--text, #1f2937);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.simple-title:hover { color: var(--primary, #1e90ff); }
.simple-rating {
  font-size: 12px;
  white-space: nowrap;
  color: #f59e0b;
}
.simple-views {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  white-space: nowrap;
  min-width: 50px;
  text-align: right;
}
@media (max-width: 768px) {
  .simple-item { padding: 10px 12px; gap: 8px; }
  .simple-title { font-size: 13px; }
  .simple-views { min-width: 40px; }
}

/* === Z-Blog Built-in Module Styles === */
#divNavBar .widget-content { padding: 10px 0; }
#divNavBar .widget-content a { display: inline-block; padding: 4px 10px; margin: 2px; color: var(--text-secondary); text-decoration: none; border-radius: var(--radius); transition: all 0.2s; font-size: 13px; }
#divNavBar .widget-content a:hover { color: var(--primary); background: var(--primary-light); }

#divCatalog .widget-content li { padding: 6px 0; border-bottom: 1px solid var(--border); }
#divCatalog .widget-content li:last-child { border-bottom: none; }
#divCatalog .widget-content li a { color: var(--text); text-decoration: none; font-size: 14px; transition: color 0.2s; }
#divCatalog .widget-content li a:hover { color: var(--primary); }

#divPrevious .widget-content li { padding: 6px 0; border-bottom: 1px solid var(--border); }
#divPrevious .widget-content li:last-child { border-bottom: none; }
#divPrevious .widget-content li a { color: var(--text); text-decoration: none; font-size: 13px; transition: color 0.2s; }
#divPrevious .widget-content li a:hover { color: var(--primary); }

#divTags .widget-content { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
#divTags .widget-content a { display: inline-block; padding: 4px 10px; background: var(--bg-card); color: var(--text-secondary); text-decoration: none; border-radius: var(--radius); font-size: 12px; border: 1px solid var(--border); transition: all 0.2s; }
#divTags .widget-content a:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

#divMisc .widget-content li { padding: 6px 0; border-bottom: 1px solid var(--border); }
#divMisc .widget-content li:last-child { border-bottom: none; }
#divMisc .widget-content li a { color: var(--text); text-decoration: none; font-size: 13px; }
#divMisc .widget-content li a:hover { color: var(--primary); }

#divConnect .widget-content li { padding: 6px 0; }
#divConnect .widget-content li a { color: var(--text); text-decoration: none; font-size: 13px; }
#divConnect .widget-content li a:hover { color: var(--primary); }

[data-theme="dark"] #divTags .widget-content a { background: var(--bg-card); border-color: var(--border); color: var(--text-secondary); }
