/* ========== CSS Variables ========== */
:root {
  --themecolor: #5b9bd5;
  --themecolor-rgb: 91, 155, 213;
  --themecolor-gradient: linear-gradient(135deg, #a8d8ea 0%, #5b9bd5 100%);
  --color-border-on-foreground-deeper: rgba(var(--themecolor-rgb));
  --body-bg: #e8f4f8;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-bg-solid: #ffffff;
  --text-color: #2c3e50;
  --text-secondary: #6c7a89;
  --text-muted: #95a5a6;
  --link-color: #5b9bd5;
  --border-color: rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.12);
  --card-radius: 15px;
  --font-serif: 'Noto Serif SC', 'PingFang SC', Georgia, 'Nimbus Roman No9 L', 'Microsoft Yahei', serif;
  --font-sans: 'Open Sans', -apple-system, 'PingFang SC', 'Microsoft Yahei', sans-serif;
  --navbar-height: 64px;
  --transition: all 0.3s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  color: var(--text-color);
  background: var(--body-bg);
  background-image: url('/images/backgrounds/bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  line-height: 1.8;
  min-height: 100vh;
  padding-top: var(--navbar-height);
  transition: var(--transition);
  overflow-x: hidden;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--themecolor);
  text-decoration: none;
}

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

.container {
  width: min(100%, 1300px);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-left: -20px;
  margin-right: -20px;
}

/* ========== Navbar ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

.navbar.scrolled {
  background: rgba(232, 244, 248, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(91, 155, 213, 0.15);
}

html.darkmode .navbar.scrolled {
  background: rgba(26, 42, 58, 0.92);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-color);
  text-decoration: none;
  margin-right: 1.5rem;
}

.navbar-collapse {
  display: flex;
  align-items: center;
}

.navbar-nav {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0;
}

.nav-link {
  color: #2c3e50;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.5rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  border-radius: 8px;
  cursor: pointer;
  background: none;
  border: none;
}
.nav-link:hover {
  color: var(--themecolor);
  background: rgba(var(--themecolor-rgb), 0.1);
}

html.darkmode .nav-link {
  color: rgba(255, 255, 255, 0.85);
}
html.darkmode .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
html.darkmode .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-link-theme .icon-moon { display: none; }
html.darkmode .nav-link-theme .icon-sun { display: none; }
html.darkmode .nav-link-theme .icon-moon { display: inline; }

.navbar-toggler {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.navbar-toggler-icon {
  display: block;
  width: 1.8rem;
  height: 2px;
  background: var(--text-color);
  position: relative;
}
.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  display: block;
  width: 1.8rem;
  height: 2px;
  background: var(--text-color);
  position: absolute;
  left: 0;
}
.navbar-toggler-icon::before { top: -7px; }
.navbar-toggler-icon::after { top: 7px; }

/* Search Overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.search-overlay.active { display: flex; }

.search-container {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.5rem;
  font-family: var(--font-serif);
  border: none;
  border-bottom: 2px solid var(--themecolor);
  background: transparent;
  outline: none;
  color: var(--text-color);
}

.search-close {
  position: absolute;
  top: 0;
  right: 20px;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
}
.search-close:hover { color: var(--text-color); }

/* ========== Hero Cover (Fullscreen) ========== */
.hero-cover {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.main-content-section {
  scroll-margin-top: var(--navbar-height);
  padding-top: 1rem;
}

.hero-cover-bg {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
}

.hero-cover-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
}

.hero-title {
  font-size: 4em;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
  font-family: 'KaiTi', 'STKaiti', '楷体', 'Noto Serif SC', serif;
  letter-spacing: 6px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 500;
  background: linear-gradient(135deg, #0d47a1 0%, #00bcd4 30%, #26a69a 60%, #7c4dff 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes hero-slide-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scroll Indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.3);
  transition: opacity 0.5s ease;
}

.hero-scroll-text {
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-scroll-arrow {
  animation: bounce-arrow 2s ease infinite;
}

@keyframes bounce-arrow {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(8px); }
  60% { transform: translateY(4px); }
}

.hero-scroll-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ========== Main Content Section ========== */
.main-content-section {
  position: relative;
  z-index: 2;
  background: var(--body-bg);
  padding-top: 2rem;
}

/* Reveal on scroll animation */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Old Banner (keep for non-home pages) ========== */
.banner-container {
  position: relative;
  margin: -1rem -15px 2rem;
  padding: 4rem 2rem 3rem;
  background: var(--themecolor-gradient);
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  overflow: hidden;
  text-align: center;
}
.banner-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.banner-inner {
  position: relative;
  z-index: 1;
}

.banner-title {
  font-size: 2.5em;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
  text-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.banner-subtitle {
  font-size: 28px;
  font-weight: 300;
  background: linear-gradient(94.75deg, #3cacf7 0%, #8365fd 43.66%, #ff8d70 64.23%, #f7c966 83.76%, #ac8f64 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== Homepage Overrides ========== */
body.is-home {
  padding-top: 0;
}

body.is-home #content.site-content {
  padding: 0;
}

body.is-home .navbar {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.is-home .navbar.scrolled {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border-color);
}

body.is-home.darkmode .navbar {
  background: transparent;
}
body.is-home.darkmode .navbar.scrolled {
  background: rgba(26, 42, 58, 0.92);
}
body.is-home.darkmode .navbar.scrolled {
  background: rgba(30, 30, 46, 0.85);
}
.site-content {
  min-height: calc(100vh - var(--navbar-height) - 120px);
  padding: 1rem 0 2rem;
}

.main-container {
  width: min(100%, 1300px);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

#leftbar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--navbar-height) + 1rem);
  align-self: flex-start;
}

#main-content {
  flex: 1;
  min-width: 0;
}

/* ========== Cards ========== */
.card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 1.5rem;
  transition: var(--transition);
  overflow: hidden;
}

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

.card-body {
  padding: 2rem 1.75rem;
}

.post-list-container .card {
  min-height: 280px;
  width: 100%;
  max-width: none;
  display: block;
  box-sizing: border-box;
  margin-left: 0;
  margin-right: 0;
}

#main-content {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
}

#main-content * {
  max-width: 100%;
}

html.darkmode .card {
  background: rgba(40, 55, 75, 0.88);
}

/* All major layout sections: transparent to show background image */
#content,
.container,
.row,
#main-content,
.site-content,
.main-container,
.post-list-container,
.shuoshuo-container,
.main-content-section,
#main-content-section {
  background: transparent;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========== Sidebar (Leftbar) ========== */
#leftbar .widget {
  margin-bottom: 1rem;
}

.leftbar-author-section {
  text-align: center;
  padding: 1.5rem 1.5rem 1rem;
}

#leftbar_overview_author_image {
  width: 100px;
  height: 100px;
  margin: auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-color: rgba(127, 127, 127, 0.1);
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.3s ease;
}
#leftbar_overview_author_image:hover {
  transform: scale(1.23);
  filter: brightness(150%);
}

#leftbar_overview_author_name {
  margin-top: 15px;
  font-size: 18px;
  font-weight: 600;
  color: #00a8a8;
}

#leftbar_overview_author_description {
  font-size: 14px;
  margin-top: -4px;
  opacity: 0.8;
  color: #c21f30;
}

/* Site Stats */
.site-state {
  display: flex;
  justify-content: center;
  padding: 0.5rem 1.5rem 1rem;
  gap: 0;
}

.site-state-item {
  flex: 1;
  text-align: center;
  border-left: 1px solid #aaa;
}
.site-state-item:first-child { border-left: none; }

.site-state-item a {
  display: block;
  color: var(--text-color);
}
.site-state-item-count {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--themecolor);
}
.site-state-item-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Leftbar Menu */
.leftbar-menu {
  list-style: none;
  padding: 0.5rem 0;
}

.leftbar-menu-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 1.5rem;
  color: var(--text-color);
  font-size: 0.95rem;
  transition: var(--transition);
  border-radius: 8px;
  margin: 2px 8px;
}
.leftbar-menu-item a:hover,
.leftbar-menu-item.current a {
  background-color: #f9f9f980;
  color: var(--themecolor);
}

.leftbar-banner-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  opacity: 0.8;
  color: var(--text-color);
  padding: 1rem 1.5rem 0.5rem;
}

.leftbar-category-list {
  list-style: none;
  padding: 0 1.5rem 1rem;
}

.leftbar-category-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  color: var(--text-color);
  font-size: 0.9rem;
  border-bottom: none;
}
.leftbar-category-item a:hover { color: var(--themecolor); }

.badge {
  background: rgba(var(--themecolor-rgb), 0.1);
  color: var(--themecolor);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 1.5rem 1rem;
}

.tag-item {
  display: inline-block;
  padding: 3px 12px;
  font-size: 0.85rem;
  background: rgba(var(--themecolor-rgb), 0.08);
  color: var(--text-color);
  border-radius: 20px;
  transition: var(--transition);
}
.tag-item:hover {
  background: var(--themecolor);
  color: #fff;
}

/* ========== Page Info Card ========== */
.bg-gradient-secondary {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.page-information-card .card-body {
  text-align: center;
}

/* ========== Post Cards (List) ========== */
.post-card .card-body {
  padding: 1.5rem;
}

/* Post card cover image */
.post-card-cover {
  display: block;
  width: 100%;
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: var(--body-bg);
  position: relative;
  border-radius: var(--card-radius) var(--card-radius) 0 0;
}

.post-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--themecolor);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  z-index: 1;
}

.post-card-info {
  padding: 1.25rem 1.5rem !important;
}

/* Back button on post detail */
.post-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--text-color);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: var(--transition);
  cursor: pointer;
  background: rgba(232, 244, 248, 0.92);
  border: 1px solid rgba(91, 155, 213, 0.3);
  border-radius: 10px;
  font-family: var(--font-serif);
  padding: 8px 18px;
  font-weight: 600;
}

.post-back-btn:hover {
  background: rgba(91, 155, 213, 0.22);
  color: var(--themecolor);
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
.post-title a {
  color: var(--text-color);
}
.post-title a:hover {
  color: var(--themecolor);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.post-meta-item a {
  color: var(--text-secondary);
}
.post-meta-item a:hover { color: var(--themecolor); }

.post-meta-top {
  background: var(--themecolor);
  color: #fff !important;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.post-meta-detail-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.8rem;
  background: rgba(var(--themecolor-rgb), 0.08);
  color: var(--text-color);
  border-radius: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  transition: var(--transition);
}
.post-meta-detail-tag:hover {
  background: var(--themecolor);
  color: #fff;
}

.post-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ========== Post Detail ========== */
.post-cover {
  margin: 0;
  overflow: hidden;
}
.post-cover-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.post-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.4;
  text-align: center;
}

.justify-center {
  justify-content: center;
}

.post-meta-detail {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.post-tags {
  margin-bottom: 1.5rem;
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.9;
  word-break: break-word;
}

.post-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(var(--themecolor-rgb), 0.2);
}

.post-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

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

.post-content ul, .post-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.post-content li {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(var(--themecolor-rgb), 0.1) !important;
  border-left: 4px solid var(--themecolor);
  border-radius: 0 8px 8px 0;
  color: var(--text-color);
}

.post-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-content code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  color: rgba(var(--themecolor-rgb));
  background: rgba(var(--themecolor-rgb), 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.post-content img {
  border-radius: 12px;
  margin: 1rem auto;
  display: block;
  max-width: 100%;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.post-content table td,
.post-content table th {
  padding: 8px 10px;
  border: 1px solid var(--border-color);
}

.post-content figure {
  margin: 1rem 0;
}

/* ========== Comments ========== */
.comment-section {
  margin-top: 1.5rem;
}

.comment-section-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.comment-form {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.col-md-4 { flex: 1; min-width: 200px; }
.col-md-6 { flex: 1; min-width: 250px; }
.col-md-8 { flex: 2; min-width: 250px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text-color);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  outline: none;
  transition: var(--transition);
}
.form-control:focus {
  border-color: var(--themecolor);
  box-shadow: 0 0 0 3px rgba(var(--themecolor-rgb), 0.15);
  background: #fff;
}

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

.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.5;
}

.btn-primary {
  background: var(--themecolor);
  color: #fff;
}
.btn-primary:hover {
  background: #4a5ed4;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(var(--themecolor-rgb), 0.4);
}

.btn-neutral {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-color);
}
.btn-neutral:hover {
  background: rgba(0, 0, 0, 0.1);
}

.btn-danger {
  background: #dc3545;
  color: #fff;
}
.btn-danger:hover { background: #c82333; }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.85rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Comments List */
.comment-item {
  display: flex;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.comment-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(var(--themecolor-rgb), 0.1);
}
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.comment-author {
  font-weight: 600;
  color: var(--text-color);
}

.comment-url {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-time {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.comment-content {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-color);
  margin-bottom: 4px;
}

.comment-reply-btn {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.comment-reply-btn:hover { color: var(--themecolor); }

.reply-form-container {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 1rem;
  background: rgba(var(--themecolor-rgb), 0.03);
  border-radius: 10px;
}

.comment-replies {
  margin-top: 0.75rem;
  padding-left: 24px;
  border-left: 2px solid rgba(var(--themecolor-rgb), 0.15);
}

.comment-reply .comment-avatar {
  width: 32px;
  height: 32px;
}

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

/* ========== Pagination ========== */
.pagination-nav {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.pagination {
  display: flex;
  list-style: none;
  gap: 6px;
}

.page-link {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  color: var(--text-color);
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  transition: var(--transition);
}
.page-link:hover {
  background: var(--themecolor);
  color: #fff;
}

.page-item.active .page-link {
  background: var(--themecolor);
  color: #fff;
}

/* ========== Footer ========== */
#footer {
  background: var(--themecolor-gradient);
  color: #fff;
  width: 100%;
  padding: 25px 20px;
  text-align: center;
  line-height: 1.8;
  opacity: 0.6;
  margin-top: 2rem;
}

/* ========== Page Header ========== */
.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.page-description {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ========== FAB Buttons ========== */
.fabtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: 999;
  transition: var(--transition);
}
.fabtn:hover {
  color: var(--themecolor);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ========== Empty State ========== */
.empty-state {
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
}

#main-content .card {
  width: 100%;
}

/* ========== Alert ========== */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ========== Dark Mode ========== */
html.darkmode body,
html.darkmode {
  --body-bg: #1a2a3a;
  --card-bg: rgba(40, 55, 75, 0.9);
  --text-color: #dce8f0;
  --text-secondary: #8fa8b8;
  --text-muted: #6a7a88;
  --border-color: rgba(255, 255, 255, 0.06);
  --link-color: #7ab8e0;
}

html.darkmode .navbar {
  background: transparent;
}

html.darkmode .search-overlay {
  background: rgba(26, 26, 46, 0.95);
}

html.darkmode .search-input {
  color: #e0e0e0;
  border-bottom-color: var(--themecolor);
}

html.darkmode .form-control {
  background: rgba(50, 50, 65, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}
html.darkmode .form-control:focus {
  background: rgba(60, 60, 75, 0.8);
}

html.darkmode .bg-gradient-secondary {
  background: rgba(66, 66, 66, 0.5) !important;
}

html.darkmode .navbar-toggler-icon,
html.darkmode .navbar-toggler-icon::before,
html.darkmode .navbar-toggler-icon::after {
  background: #fff;
}

html.darkmode .btm-attachment-img {
  filter: brightness(0.8);
}

html.darkmode .fabtn {
  background: rgba(66, 66, 66, 0.9);
}

html.darkmode #footer {
  background: rgba(40, 40, 60, 0.9);
}

/* ========== Nav Active ========== */
.nav-link.active {
  color: var(--themecolor);
  background: rgba(var(--themecolor-rgb), 0.08);
}

/* ========== About / Page Header ========== */
.post-header.text-center {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.post-header .post-meta-detail {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.justify-center {
  justify-content: center;
}

/* ========== Archive ========== */
.archive-year-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 1.5rem 0 0.75rem;
  padding-left: 0.5rem;
}

.archive-month-card {
  margin-bottom: 0.75rem;
}

.archive-month-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--themecolor);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.archive-post-list {
  list-style: none;
  padding: 0;
}

.archive-post-item {
  padding: 6px 0;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.95rem;
}

.archive-post-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  min-width: 85px;
}

.archive-post-item a {
  color: var(--text-color);
}
.archive-post-item a:hover { color: var(--themecolor); }

/* ========== 说说 (Say) ========== */
.shuoshuo-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shuoshuo-card .card-body {
  padding: 1.25rem 1.5rem;
}

.shuoshuo-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.shuoshuo-content {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  word-break: break-word;
}

.shuoshuo-content img {
  max-width: 100%;
  border-radius: 10px;
  margin: 0.5rem 0;
}

.shuoshuo-content p {
  margin-bottom: 0.5rem;
}

.shuoshuo-comments {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(var(--themecolor-rgb), 0.04);
  border-radius: 10px;
}

.shuoshuo-comment-item {
  padding: 4px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}
.shuoshuo-comment-item:last-child {
  border-bottom: none;
}

.shuoshuo-comment-author {
  font-weight: 600;
  color: var(--themecolor);
}

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

.shuoshuo-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.shuoshuo-time {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover {
  border-color: var(--themecolor);
  color: var(--themecolor);
  background: rgba(var(--themecolor-rgb), 0.05);
}

.shuoshuo-comment-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.form-control-sm {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* ========== Page Banner (non-home pages) ========== */
.page-banner {
  background: transparent;
  padding: 2.5rem 1.5rem;
  text-align: center;
  min-height: 33vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-banner-inner {
  position: relative;
  z-index: 1;
}

.page-banner-inner {
  position: relative;
  z-index: 1;
}

.page-banner-title {
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  font-family: 'KaiTi', 'STKaiti', '楷体', 'Noto Serif SC', serif;
  letter-spacing: 5px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

/* Typewriter cursor */
.typewriter-cursor {
  display: inline-block;
  animation: blink 0.8s step-end infinite;
  color: var(--themecolor);
  font-weight: 300;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Page transition */
.post-card, .shuoshuo-card, .post-detail, .page-header, .comment-section {
  animation: page-enter 0.45s ease both;
}

/* Page footer card */
.page-footer-card {
  margin-top: 1.5rem;
  background: rgba(232, 244, 248, 0.75);
  border: 1px solid rgba(91, 155, 213, 0.15);
}

html.darkmode .page-footer-card {
  background: rgba(40, 55, 75, 0.75);
}

.post-list-container .post-card:nth-child(1) { animation-delay: 0.05s; }
.post-list-container .post-card:nth-child(2) { animation-delay: 0.1s; }
.post-list-container .post-card:nth-child(3) { animation-delay: 0.15s; }
.post-list-container .post-card:nth-child(4) { animation-delay: 0.2s; }
.post-list-container .post-card:nth-child(5) { animation-delay: 0.25s; }
.post-list-container .post-card:nth-child(6) { animation-delay: 0.3s; }
.post-list-container .post-card:nth-child(7) { animation-delay: 0.35s; }
.post-list-container .post-card:nth-child(8) { animation-delay: 0.4s; }

.shuoshuo-container .shuoshuo-card:nth-child(1) { animation-delay: 0.05s; }
.shuoshuo-container .shuoshuo-card:nth-child(2) { animation-delay: 0.1s; }
.shuoshuo-container .shuoshuo-card:nth-child(3) { animation-delay: 0.15s; }
.shuoshuo-container .shuoshuo-card:nth-child(4) { animation-delay: 0.2s; }
.shuoshuo-container .shuoshuo-card:nth-child(5) { animation-delay: 0.25s; }
.shuoshuo-container .shuoshuo-card:nth-child(6) { animation-delay: 0.3s; }
.shuoshuo-container .shuoshuo-card:nth-child(7) { animation-delay: 0.35s; }
.shuoshuo-container .shuoshuo-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes page-enter {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.page-banner-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  background: linear-gradient(135deg, #0d47a1 0%, #00bcd4 30%, #26a69a 60%, #7c4dff 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========== Page Title Bar (articles/shuoshuo) ========== */
.page-title-bar {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow);
  padding: 1.25rem 20px;
  margin: 0 auto 1.5rem;
  width: min(100%, 1300px);
  box-sizing: border-box;
}

html.darkmode .page-title-bar {
  background: rgba(66, 66, 66, 0.85);
}

.page-title-bar-text {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  font-family: var(--font-serif);
  text-align: center;
}


/* ========== Post List Full Width ========== */
#main-content {
  flex: 1;
  min-width: 0;
}

#main-content .post-list-container,
#main-content .shuoshuo-container,
#main-content .main-content-section,
#main-content .post-detail,
#main-content .comment-section {
  width: 100%;
  display: block;
}

#main-content .card {
  width: 100%;
  display: block;
  box-sizing: border-box;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
  #leftbar {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 999;
    background: var(--body-bg);
    overflow-y: auto;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
  }
  #leftbar.open { display: block; }

  #main-content {
    width: 100%;
  }

  .navbar-toggler {
    display: block;
  }

  .navbar-collapse {
    display: none;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--card-bg-solid);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
    box-shadow: var(--shadow);
    flex-direction: column;
  }
  .navbar-collapse.open { display: flex; }

  .navbar-nav {
    flex-direction: column;
    width: 100%;
  }

  .nav-link {
    padding: 12px 1rem;
    width: 100%;
  }

  .banner-container {
    padding: 3rem 1.5rem 2rem;
  }
  .banner-title { font-size: 1.8em; }
  .banner-subtitle { font-size: 20px; }

  .post-title { font-size: 1.25rem; }
  .post-detail-title { font-size: 1.4rem; }

  .form-row {
    flex-direction: column;
  }
  .col-md-4, .col-md-6, .col-md-8 {
    flex: none;
    min-width: 100%;
  }

  .comment-replies {
    padding-left: 16px;
  }
}

@media (max-width: 576px) {
  .banner-container {
    padding: 2rem 1rem 1.5rem;
  }
  .banner-title { font-size: 1.5em; }
  .banner-subtitle { font-size: 18px; }

  .pagination-nav {
    overflow-x: auto;
  }

  .site-state {
    flex-direction: row;
  }

  .post-meta {
    gap: 0.5rem;
  }
}
