:root {
  --logo: #ff6b6b; /* 明亮的珊瑚红 - 充满活力 */
  --nav: #ff9e80; /* 温暖的浅橙色 - 友好活泼 */
  --body: #f8f5e6; /* 浅奶油色 - 温暖柔和 */
  --font: #333;
  --a: #333;
}

* {
  box-sizing: border-box;
  font-family: Baloo, sans-serif;
}

body {
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--font);
  background: var(--body);
  background-size: contain;
}
html {
  font-size: 16px;
}
img {
  object-fit: cover;
}
a {
  line-height: 20px;
  text-decoration: none;
  color: var(--a);
}

a:hover,
a:active {
  text-decoration: none;
}

strong {
  font-weight: bolder;
}

.fx-r {
  display: flex;
  flex-direction: row;
}

.fx-h {
  display: flex;
  flex-direction: column;
}

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

.fx-bc {
  align-items: center;
}

/* Markdown容器基础样式 */
.markdown-container {
  font-family: Baloo, sans-serif;
  line-height: 1.8;
}
/* Markdown内容样式 */
#markdown-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  line-height: 1.8;
}

#markdown-content h1,
#markdown-content h2,
#markdown-content h3 {
  margin: 1.5em 0 0.8em;
  color: var(--title);
  font-weight: bold;
}

#markdown-content h1 {
  font-size: 2em;
  border-bottom: 2px solid var(--category-bg);
  padding-bottom: 0.3em;
}

#markdown-content h2 {
  font-size: 1.5em;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.2em;
}

#markdown-content p {
  margin-bottom: 1.2em;
}

#markdown-content ul,
#markdown-content ol {
  margin: 1em 0 1em 2em;
  padding-left: 0;
}

#markdown-content li {
  margin-bottom: 0.5em;
  list-style-type: disc;
}

#markdown-content img {
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-container {
  width: 100%;
  overflow-x: scroll;
}
#markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  border: 1px solid #ddd;
}

#markdown-content th,
#markdown-content td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: left;
}

#markdown-content th {
  background-color: #f5f5f5;
  font-weight: bold;
}

#markdown-content tr:nth-child(even) {
  background-color: #f9f9f9;
}

#markdown-content blockquote {
  border-left: 4px solid var(--category-bg);
  padding: 0.5em 1em;
  margin: 1em 0;
  background-color: #f9f9f9;
  color: #666;
}

#markdown-content hr {
  border: 0;
  border-top: 1px solid #eee;
  margin: 2em 0;
}

#markdown-content pre {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

#markdown-content code {
  font-family: "Courier New", monospace;
  font-size: 14px;
  color: #333;
  line-height: 1.5;
}

#markdown-content pre code {
  display: block;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  overflow: visible;
}
.hljs {
  background: #f8f8f8;
  border-radius: 4px;
  padding: 16px;
}

.hljs-keyword,
.hljs-built_in {
  color: #d73a49;
}
.hljs-strong,
.hljs-emphasis {
  color: #032f62 !important;
}
.hljs-string {
  color: #032f62;
}

.hljs-comment {
  color: #6a737d;
}

/* 定义全局滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  border-radius: 4px;
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #c1c1c1;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 回到顶部按钮样式 */
#back-to-top {
  font-size: 24px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: opacity 0.3s;
  color: white;
  border: none;
  border-radius: 50%;
  background-color: #007bff;
}

#back-to-top:hover {
  opacity: 0.8;
}

.navLogo {
  width: 64px;
  height: 64px;
}

.navbar {
  background: var(--nav);
  z-index: 5;
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  position: absolute;
  right: 30px;
  width: 0;
  height: 36px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 18px;
  outline: none;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s ease;
}
.search-input.active {
  width: 200px;
  padding: 0 15px;
  opacity: 1;
}

.search-input:focus {
  border-color: var(--logo);
  box-shadow: 0 0 5px rgba(0, 156, 255, 0.3);
}

.search-icon {
  transition: transform 0.3s ease;
}

.search-icon:hover {
  transform: scale(1.1);
}

/* 内容区域样式 */
.content-container {
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
}

/* 文章信息区域 */
.item-info {
  padding: 20px;
}

.item-category {
  display: inline-block;
  padding: 4px 10px;
  background: #f0f4f8;
  color: #4a5568;
  font-size: 0.75rem;
  border-radius: 20px;
  margin-bottom: 10px;
}

.item-title {
  margin: 0 0 12px 0;
  color: #1a202c;
  font-size: 1.15rem;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  color: #a0aec0;
  font-size: 0.8rem;
}

/* 差异化卡片大小 */
.featured-large {
  grid-column: span 2;
  grid-row: span 2;
}

.featured-medium {
  grid-column: span 1;
  grid-row: span 1;
}

.featured-small {
  grid-column: span 1;
  grid-row: span 1;
}

.featured-large .image-placeholder {
  /* height: 320px;*/
  flex: 1;
}

/* 普通文章列表样式 */
.article-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
}

.article-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: background 0.3s ease;
}

.article-item:hover {
  background: #f8f9fa;
}

.article-item .item-excerpt {
  margin: 0;
  color: #718096;
  font-size: 0.875rem;
  line-height: 1.5;
}
/* 区域标题样式优化 */
.section-title {
  width: 100%;
  margin: 40px 0 28px;
  position: relative;
}

.section-title h2 {
  font-size: 1.75rem;
  color: #2d3748;
  margin: 0 0 12px 0;
  display: inline-block;
  position: relative;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-title h2::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 45px;
  height: 3px;
  background: var(--logo);
  border-radius: 2px;
}

.title-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 156, 255, 0) 0%, rgba(0, 156, 255, 0.2) 50%, rgba(0, 156, 255, 0) 100%);
  margin-top: 16px;
}

/* 最新文章区域样式优化 */
.featured-section {
  width: 100%;
  margin-bottom: 45px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}

.featured-item {
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  opacity: 0;
  display: flex;
  flex-direction: column;
  transform: translateY(15px);
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 图片占位块优化 */
.image-placeholder {
  width: 100%;
  height: 180px;
  transition: all 0.5s ease;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.image-placeholder::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
}

/* 分类渐变背景优化 */
.category-training {
  background: linear-gradient(135deg, #edf8ff 0%, #d6efff 100%);
}

.category-health {
  background: linear-gradient(135deg, #f0fff4 0%, #ccfbf1 100%);
}

.category-news {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}
.category-behavior {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

/* 文章信息区域优化 */
.item-info {
  padding: 22px 20px 20px;
  position: relative;
}

.item-category {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(0, 156, 255, 0.08);
  color: var(--logo);
  font-size: 0.72rem;
  border-radius: 12px;
  margin-bottom: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
  letter-spacing: 0.2px;
}

.featured-item:hover .item-category {
  background: var(--logo);
  color: white;
}

.item-title {
  margin: 0 0 10px 0;
  color: #2d3748;
  font-size: 1.15rem;
  line-height: 1.45;
  transition: color 0.3s ease;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.featured-item:hover .item-title {
  color: var(--logo);
}

.item-meta {
  display: flex;
  justify-content: space-between;
  color: #718096;
  font-size: 0.78rem;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

/* 差异化卡片大小优化 */

.featured-large .item-title {
  font-size: 1.35rem;
  line-height: 1.4;
}

.featured-medium .image-placeholder {
  height: 200px;
}

/* 普通文章列表优化 */
.article-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  cursor: pointer;
  margin-bottom: 20px;
}

.article-item {
  display: flex;
  gap: 18px;
  padding: 18px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s ease forwards;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.article-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.article-item .item-title {
  font-size: 1.05rem;
  margin-bottom: 6px;
  line-height: 1.4;
}

.article-item .item-excerpt {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.9;
}

/* 图片占位块（小尺寸）优化 */
.image-placeholder.small {
  flex-shrink: 0;
  width: 180px;
  height: 120px;
  border-radius: 6px;
}
/* 更多文章按钮样式 */
.more-articles-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--logo);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 20px auto 0;
}

.more-articles-btn:hover {
  background-color: #0086e6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 156, 255, 0.3);
}

.more-articles-btn svg {
  transition: transform 0.3s ease;
}

.more-articles-btn:hover svg {
  transform: rotate(90deg);
}

/* 菜单弹窗样式 */
.menu-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  background-color: rgba(0, 0, 0, 0.5);
  z-index: 13;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.menu-content {
  background-color: white;
  width: 85%;
  max-width: 400px;
  padding: 10px;
  padding-bottom: 30px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
}

.menu-items {
  padding: 20px;
}

.menu-item {
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
  color: #333;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.menu-item:hover {
  color: var(--logo);
}

/* 页脚样式 */
.footer {
  background-color: #f8f9fa;
  padding: 40px 0 20px;
  border-top: 1px solid #eee;
}

.footer-container {
  width: 80%;
  max-width: 1500px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

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

.footer-logo {
  height: 40px;
  margin-bottom: 15px;
}

.footer-desc {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.footer-title {
  font-size: 1rem;
  color: #343a40;
  margin-bottom: 15px;
  position: relative;
  padding-bottom: 8px;
}

.footer-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 30px;
  height: 2px;
  background-color: var(--logo);
}

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

.footer-nav li {
  margin-bottom: 10px;
}

.footer-link {
  color: #6c757d;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.9rem;
}

.footer-link:hover {
  color: var(--logo);
}

.footer-info .footer-text {
  color: #6c757d;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}
.detail-title {
  font-size: 36px;
  font-weight: bold;
}
.copyright {
  color: #6c757d;
  font-size: 0.85rem;
  margin: 0;
}
/* 横向滚动容器样式 */
.horizontal-scroll-container {
  width: 100%;
  position: relative;
  padding: 5px 0 25px;
}

.horizontal-scroll-list {
  display: flex;
  gap: 20px;
  padding: 5px 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  overflow-y: hidden;
}

/* 横向滚动项目样式 */
.horizontal-item {
  flex: 0 0 280px;
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInUp 0.5s ease forwards;
  cursor: pointer;
}

.horizontal-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.horizontal-item .image-placeholder {
  height: 160px;
}

.horizontal-item .item-info {
  padding: 18px 15px;
}

.horizontal-item .item-title {
  font-size: 1.05rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.horizontal-item .item-excerpt {
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #6b7280;
}

/* 滚动指示器 */
.scroll-indicator {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: rgba(0, 156, 255, 0.3);
  border-radius: 2px;
  animation: scrollPulse 2s infinite;
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.6;
    width: 40px;
  }
  50% {
    opacity: 1;
    width: 50px;
  }
}
@media (min-width: 1024px) {
  .featured-section {
    grid-template-columns: repeat(4, 1fr);
    margin: 0 auto 45px;
  }
}

@media (max-width: 767px) {
  #markdown-content h2 {
    font-size: 18px;
  }
  #markdown-content h3 {
    font-size: 16px;
  }
  .detail-title {
    font-size: 20px;
  }
  .image-placeholder.small {
    /* height: 85px; */
    width: 120px;
  }
  .search-input.active {
    width: 100px;
  }
  .featured-large .image-placeholder {
    height: 180px;
    flex: none;
  }
  .horizontal-scroll-list {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* 隐藏滚动条但保留功能 */
  }

  .horizontal-scroll-list::-webkit-scrollbar {
    display: none;
  }
  .horizontal-scroll-container {
    padding: 5px 10px 25px;
    margin-left: -10px;
    margin-right: -10px;
    width: calc(100% + 20px);
  }

  .horizontal-item {
    flex: 0 0 240px;
  }

  .horizontal-item .image-placeholder {
    height: 140px;
  }
  .content-container {
    width: 98%;
  }
  .section-title {
    margin: 30px 0 20px;
  }
  .section-title h2 {
    font-size: 1.45rem;
  }
  .featured-section {
    gap: 18px;
    margin-bottom: 30px;
    grid-template-columns: 1fr;
  }

  /* 新增：移动端统一卡片尺寸 */
  .featured-item {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }

  .item-info {
    padding: 18px 15px 15px;
  }
  .item-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5; /* 设置合适的行高 */
    max-height: 3em; /* 两行高度，根据实际行高调整 */
  }
  .featured-large .item-title {
    font-size: 1.2rem;
  }
  .article-item {
    gap: 15px;
    padding: 15px;
  }
}
