/* ================================
   全局基础样式
================================ */

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

body {
  font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  background-color: #ffffff;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}


/* ================================
   顶部导航栏
================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.site-logo img {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 6px;
}

.site-title {
  background: linear-gradient(90deg, #4f6bed 0%, #6d5dfc 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.main-navigation .nav-menu {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.main-navigation .nav-menu > li {
  position: relative;
}

.main-navigation .nav-menu > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  color: #1f2937;
  font-family: "Inter", "Segoe UI", "Microsoft Yahei", sans-serif;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.main-navigation .nav-menu > li > a::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #4f6bed 0%, #6d5dfc 100%);
  border-radius: 999px;
  opacity: 0;
  transform: scaleX(0.45);
  transform-origin: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.main-navigation .nav-menu > li > a:hover {
  color: #4f46e5;
  background: #f3f6fb;
}

.main-navigation .nav-menu > li > a:hover::before {
  opacity: 1;
  transform: scaleX(1);
}

.main-navigation .menu-item-has-children > a::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border-right: 1.6px solid #6b7280;
  border-bottom: 1.6px solid #6b7280;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.main-navigation .menu-item-has-children:hover > a::after {
  border-color: #4f46e5;
  transform: rotate(225deg) translateY(-1px);
}

.main-navigation .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: block;
  min-width: 240px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #dbe1ea;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.main-navigation .menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.main-navigation .sub-menu li {
  display: block;
}

.main-navigation .sub-menu a {
  display: block;
  padding: 11px 12px;
  border-radius: 6px;
  color: #374151;
  font-family: "Inter", "Segoe UI", "Microsoft Yahei", sans-serif;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.18s ease, background-color 0.18s ease, padding-left 0.18s ease;
}

.main-navigation .sub-menu a:hover {
  color: #4f46e5;
  background: #f3f6fb;
  padding-left: 16px;
}

.nav-search-link {
  gap: 6px;
}

.nav-search-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}


/* ================================
   主体布局
================================ */

.main-container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 8px;
}

.content-wrapper {
  width: 100%;
}

.main-content {
  width: 100%;
  min-width: 0;
}

.content-body.with-sidebar {
  display: flex;
  gap: 0;
  align-items: flex-start;
  padding: 24px 0 0;
}

.content-body.with-sidebar .sidebar {
  position: sticky;
  top: 96px;
  width: 250px;
  flex-shrink: 0;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding-right: 16px;
}

.content-body.with-sidebar .sidebar::-webkit-scrollbar {
  width: 6px;
}

.content-body.with-sidebar .sidebar::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.content-body.with-sidebar .main-content {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 0 0 92px 24px;
  border-left: 1px solid #e5e7eb;
}

.content-body.no-sidebar .main-content {
  width: 100%;
}

/* 分割线纵贯上下并触达页脚上沿横线 */
.main-container:has(.content-body.with-sidebar) + .site-footer {
  margin-top: 0;
}


/* ================================
   普通文章模板
================================ */

.normal-post-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.normal-post-card {
  padding: 32px 36px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.normal-post-header {
  margin-bottom: 28px;
}

.normal-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: #6b7280;
  font-size: 13px;
}

.normal-post-title {
  margin: 0;
  color: #111827;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.25;
}

.normal-post-content {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.95;
}

.normal-post-content p {
  margin: 0 0 1.15em;
}

.normal-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.normal-post-content h2,
.normal-post-content h3,
.normal-post-content h4 {
  margin-top: 1.7em;
  margin-bottom: 0.75em;
  color: #111827;
}

.normal-post-content pre {
  overflow: auto;
  padding: 16px;
  color: #e5e7eb;
  background: #0f172a;
  border-radius: 12px;
}

.normal-post-content blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  color: #374151;
  background: #f8fbff;
  border-left: 4px solid #1677ff;
  border-radius: 0 10px 10px 0;
}


/* ================================
   页脚
================================ */

.site-footer {
  margin-top: 52px;
  padding: 42px 0 24px;
  color: #1f2937;
  background: #ffffff;
  border-top: 1px solid #edf2f7;
}

.footer-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

.footer-main {
  display: grid;
  grid-template-columns: 2.4fr 0.8fr 0.8fr 0.8fr;
  column-gap: 30px;
  align-items: start;
  padding-bottom: 28px;
}

.footer-about h3 {
  margin: 0 0 14px;
  color: #1e3a8a;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.footer-about p {
  max-width: 440px;
  margin: 0;
  color: #334155;
  font-size: 15px;
  line-height: 1.85;
}

.footer-stats {
  display: flex;
  gap: 26px;
  margin-top: 22px;
}

.footer-stat-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-stat-item strong {
  color: #1e3a8a;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
}

.footer-stat-item span {
  color: #475569;
  font-size: 13px;
}

.footer-nav h4,
.footer-social h4,
.footer-contact h4 {
  margin: 0 0 14px;
  color: #1e3a8a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
}

.footer-nav ul,
.footer-contact ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav li,
.footer-contact li {
  margin-bottom: 9px;
}

.footer-nav a,
.footer-social a {
  color: #1f2937;
  font-size: 15px;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-nav a:hover,
.footer-social a:hover {
  color: #1d4ed8;
}

.footer-contact span {
  color: #1f2937;
  font-size: 15px;
  line-height: 1.6;
}

.social-icons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
}

.social-icon-image {
  display: inline-block;
  object-fit: contain;
  vertical-align: middle;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.footer-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-bottom-left p {
  margin: 0;
  color: #334155;
  font-size: 14px;
}

.footer-records {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-record {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 5px;
  color: #475569;
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.footer-record:hover {
  color: #1d4ed8;
}

.footer-record-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  object-fit: contain;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-bottom-links a {
  color: #1f2937;
  font-size: 14px;
  text-decoration: none;
  transition: color 0.18s ease;
}

.footer-bottom-links a:hover {
  color: #1d4ed8;
}


/* ================================
   响应式
================================ */

@media (max-width: 1100px) {
  .content-body.with-sidebar {
    flex-direction: column;
  }

  .content-body.with-sidebar .sidebar {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
  }

  .content-body.with-sidebar .main-content {
    border-left: none;
    padding: 0 0 40px;
  }
}

@media (max-width: 992px) {
  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 40px 56px;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
  }

  .header-right {
    width: 100%;
    justify-content: center;
  }

  .main-navigation .nav-menu {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .main-navigation .nav-menu > li > a {
    min-height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }

  .main-navigation .nav-menu > li > a::before {
    left: 12px;
    right: 12px;
  }

  .main-navigation .sub-menu {
    position: static;
    margin-top: 6px;
    box-shadow: none;
  }

  .content-body.with-sidebar {
    padding: 18px 0 30px;
    gap: 20px;
  }

  .normal-post-page {
    padding: 20px 14px 36px;
  }

  .normal-post-card {
    padding: 22px 18px;
    border-radius: 14px;
  }

  .normal-post-title {
    font-size: 30px;
  }

  .site-footer {
    padding: 32px 0 22px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-stats {
    gap: 24px;
    flex-wrap: wrap;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-bottom-links {
    flex-wrap: wrap;
    gap: 16px;
  }
}

@media (max-width: 520px) {
  .site-header {
    position: sticky;
  }

  .header-container {
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

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

  .site-logo img {
    width: 32px;
    height: 32px;
  }

  .site-title {
    font-size: 22px;
  }

  .header-right {
    justify-content: flex-start;
    overflow: hidden;
  }

  .main-navigation {
    width: 100%;
    min-width: 0;
  }

  .main-navigation .nav-menu {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-navigation .nav-menu::-webkit-scrollbar {
    display: none;
  }

  .main-navigation .nav-menu > li {
    flex: 0 0 auto;
  }

  .main-navigation .nav-menu > li > a {
    min-height: 34px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .main-navigation .nav-menu > li > a::before {
    left: 10px;
    right: 10px;
    height: 2px;
  }

  .main-navigation .menu-item-has-children > a::after {
    width: 6px;
    height: 6px;
    margin-left: 7px;
  }

  .main-navigation .sub-menu {
    display: none;
  }

  .site-footer {
    margin-top: 36px;
    padding: 26px 0 18px;
  }

  .footer-content {
    padding: 0 14px;
  }

  .footer-main {
    gap: 20px;
    padding-bottom: 20px;
  }

  .footer-about h3 {
    margin-bottom: 10px;
    font-size: 24px;
  }

  .footer-about p {
    max-width: none;
    font-size: 13px;
    line-height: 1.7;
  }

  .footer-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
  }

  .footer-stat-item {
    min-width: 0;
  }

  .footer-stat-item strong {
    font-size: 18px;
  }

  .footer-stat-item span {
    font-size: 12px;
  }

  .footer-nav h4,
  .footer-social h4,
  .footer-contact h4 {
    margin-bottom: 10px;
    font-size: 16px;
  }

  .footer-nav li,
  .footer-contact li {
    margin-bottom: 7px;
  }

  .footer-nav a,
  .footer-social a,
  .footer-contact span {
    font-size: 13px;
    line-height: 1.5;
  }

  .social-icons {
    gap: 8px;
  }

  .footer-bottom {
    gap: 12px;
    padding-top: 16px;
  }

  .footer-bottom-left {
    width: 100%;
    gap: 7px;
  }

  .footer-bottom-left p {
    font-size: 12px;
  }

  .footer-records {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .footer-record {
    max-width: 100%;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .footer-bottom-links {
    gap: 8px 14px;
  }

  .footer-bottom-links a {
    font-size: 12px;
  }
}

/* ================================
   默认单页模板
================================ */

.default-page-shell {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 260px);
  padding: 64px 20px 84px;
}

.default-page-card {
  width: min(100%, 980px);
  min-height: 520px;
  padding: 52px 60px 58px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

.default-page-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid #edf2f7;
}

.default-page-title {
  margin: 0;
  color: #111827;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
}

.default-page-content {
  color: #1f2937;
  font-size: 16px;
  line-height: 1.95;
}

.default-page-content p {
  margin: 0 0 1.15em;
}

.default-page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.default-page-content h2,
.default-page-content h3,
.default-page-content h4 {
  margin-top: 1.7em;
  margin-bottom: 0.75em;
  color: #111827;
}

.default-page-content ul,
.default-page-content ol {
  margin: 0 0 1.15em 1.35em;
  padding: 0;
}

.default-page-content ul {
  list-style: disc;
}

.default-page-content ol {
  list-style: decimal;
}

.default-page-content li {
  margin-bottom: 0.45em;
}

.default-page-content pre {
  overflow: auto;
  padding: 16px;
  color: #e5e7eb;
  background: #0f172a;
  border-radius: 12px;
}

.default-page-content blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  color: #374151;
  background: #f8fbff;
  border-left: 4px solid #1677ff;
  border-radius: 0 10px 10px 0;
}


/* ================================
   错误页面
================================ */

.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: calc(100vh - 200px);
  padding: 64px 20px 84px;
}

.error-card {
  width: min(100%, 560px);
  padding: 48px 44px 52px;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.error-code {
  margin: 0 0 10px;
  background: linear-gradient(90deg, #4f6bed 0%, #6d5dfc 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: 72px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.error-message {
  margin: 0 0 26px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.8;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.error-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(90deg, #4f6bed 0%, #6d5dfc 100%);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.18s ease;
}

.error-button:hover {
  opacity: 0.9;
}

.error-button-secondary {
  color: #4f46e5;
  background: #eef2ff;
}

.error-button-secondary:hover {
  opacity: 1;
  background: #e0e7ff;
}


/* ================================
   占位页面
================================ */

.placeholder-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.placeholder-page-card {
  padding: 24px 28px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.placeholder-page-title {
  margin: 0 0 16px;
  color: #111827;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
}

.placeholder-page-subtitle {
  margin: 20px 0 12px;
  color: #374151;
  font-size: 18px;
  font-weight: 700;
}

.placeholder-page-list {
  margin: 0;
  padding-left: 18px;
}

.placeholder-page-list li + li {
  margin-top: 8px;
}

.placeholder-page-link {
  color: #2563eb;
  line-height: 1.7;
}

.placeholder-page-link:hover {
  color: #1d4ed8;
}

.placeholder-page-pagination {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.placeholder-page-page-link {
  color: #2563eb;
  font-weight: 600;
}

.placeholder-page-page-link:hover {
  color: #1d4ed8;
}

@media (max-width: 768px) {
  .default-page-shell {
    min-height: auto;
    padding: 28px 14px 44px;
  }

  .default-page-card {
    min-height: 420px;
    padding: 28px 20px 34px;
    border-radius: 14px;
  }

  .default-page-title {
    font-size: 30px;
  }

  .placeholder-page {
    padding: 20px 14px 36px;
  }

  .placeholder-page-card {
    padding: 18px 16px;
    border-radius: 14px;
  }

  .placeholder-page-title {
    font-size: 24px;
  }

  .error-page {
    min-height: auto;
    padding: 40px 14px 52px;
  }

  .error-card {
    padding: 36px 24px 40px;
  }

  .error-code {
    font-size: 56px;
  }
}
