/* 基础样式设置 */
:root {
  --color-orange: #FF8C00;
  --color-yellow: #FFD700;
  --color-bg: #FFFBEB;
  --color-text: #5D4037;
  --color-text-light: #795548;
  --font-primary: 'Quicksand', 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-display: 'Zhi Mang Xing', 'Ma Shan Zheng', 'Noto Serif SC', serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
}

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

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

body {
  font-family: var(--font-primary);
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  line-height: 1.7;
  letter-spacing: 0.02em;
}

/* 字体优化 */
h5, h6, .brand-font {
  font-family: var(--font-display);
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0.05em;
}

/* h1 特定字体设置 */
h1 {
  font-family: 'Ma Shan Zheng', 'Zhi Mang Xing', 'Noto Serif SC', serif;
  font-weight: normal;
  line-height: 1.1;
  letter-spacing: 0.08em;
}

/* h2 特定字体设置 */
h2 {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-weight: normal;
  line-height: 1.2;
  letter-spacing: 0.06em;
}

/* h3 特定字体设置 */
h3 {
  font-family: 'Noto Serif SC', 'Zhi Mang Xing', serif;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.04em;
}

/* h4 特定字体设置 */
h4 {
  font-family: 'Quicksand', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: var(--color-text-light);
}

/* 全局a标签样式 */
a {
  font-family: 'Quicksand', 'SF Pro Display', 'Noto Sans SC', sans-serif;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
}

/* 文本容器优化 */
.text-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 字体样式 */
/* 字体样式已整合到基础样式中 */

/* 动漫风格滚动条 */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-orange);
  border-radius: 5px;
  border: 2px solid var(--color-bg);
}

/* 动漫风格卡片阴影 */
.anime-shadow {
  box-shadow: 6px 6px 0px rgba(93, 64, 55, 0.2);
  transition: all 0.3s ease;
}

.anime-shadow:hover {
  transform: translate(-2px, -2px);
  box-shadow: 10px 10px 0px rgba(255, 140, 0, 0.3);
}

/* 导航栏样式 */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.5s ease;
  padding: 1.5rem 1rem;
}

#navbar.scrolled {
  background-color: rgba(255, 251, 235, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 1rem;
}

#navbar.scrolled #logo, 
#navbar.scrolled .nav-link {
  color: var(--color-text);
}

#navbar.scrolled #github-btn {
  border-color: var(--color-orange);
  color: var(--color-orange);
}

/* 导航栏移动端布局优化 */
@media (max-width: 768px) {
  #navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #navbar .nav-links {
    display: flex;
    gap: 1rem;
  }
  
  #navbar .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Hero部分样式 */
.hero {
  position: relative;
  width: 100%;
  height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-yellow), var(--color-orange), #FF4500);
}

/* 气泡背景动画 */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.3);
  animation: float 20s infinite linear;
  z-index: 0;
}

@keyframes float {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}

/* 动画效果 */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

/* Journal部分样式 */
#journal {
  background-color: #F5F2EB;
  padding: 8rem 1.5rem;
}

/* 文章卡片样式优化 */
.article-card {
  cursor: pointer;
  background-color: white;
  border: 4px solid var(--color-yellow);
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 10px 10px 0px rgba(255, 140, 0, 0.3);
}

.article-card img {
  width: 100%;
  height: auto;
  min-height: 150px;
  max-height: 250px;
  object-fit: cover;
  border-radius: 1rem;
  border: 2px solid var(--color-bg);
  transition: transform 1s ease;
  margin-bottom: 1.25rem;
}

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

.article-card h3 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  line-height: 1.4;
}

.article-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-light);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .meta-info {
  font-size: 0.85rem;
  color: var(--color-orange);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-card .meta-info::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--color-yellow);
  border-radius: 50%;
}

/* 页脚样式 */
footer {
  background-color: #EBE7DE;
  padding: 6rem 1.5rem 3rem;
  color: #5D5A53;
}

/* 页脚移动端优化 */
@media (max-width: 768px) {
  footer {
    text-align: center;
  }
  
  footer .footer-content {
    flex-direction: column;
    gap: 2rem;
  }
}

/* 聊天助手相关样式已删除 */

/* 响应式设计 */
/* 小屏幕手机优化 (320px - 480px) */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.75rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  #journal {
    padding: 5rem 0.75rem;
  }
  
  #about {
    padding: 5rem 0.75rem;
  }
  
  #journal-detail {
    padding: 5rem 0.75rem 3rem;
  }
  
  .hero {
    height: 70vh;
  }
  
  .article-content {
    padding: 1.5rem 1rem;
    border-radius: 1rem;
  }
  
  .article-content h1 {
    font-size: 1.75rem;
  }
  
  .article-content h2 {
    font-size: 1.5rem;
    padding-left: 0.75rem;
  }
  
  .article-content h3 {
    font-size: 1.25rem;
  }
  
  .article-card {
    padding: 0.75rem;
  }
  
  .article-card img {
    height: 150px;
  }
  
  .article-card h3 {
    font-size: 1.5rem;
  }
  
  footer {
    padding: 4rem 0.75rem 2rem;
  }
  
  /* 导航栏移动端优化 */
  #navbar {
    padding: 1rem 0;
  }
  
  #navbar.scrolled {
    padding: 0.75rem 0;
  }
}

/* 中等屏幕手机优化 (481px - 768px) */
@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem !important;
  }
  
  h2 {
    font-size: 1.85rem !important;
  }
  
  h3 {
    font-size: 1.4rem !important;
  }
  
  body {
    font-size: 0.95rem;
  }
  
  #journal {
    padding: 6rem 1rem;
  }
  
  #about {
    padding: 6rem 1rem;
  }
  
  #journal-detail {
    padding: 6rem 1rem 3rem;
  }
  
  .hero {
    height: 75vh;
  }
  
  .article-content {
    padding: 2rem 1.25rem;
    border-radius: 1.5rem;
  }
  
  .article-content h1 {
    font-size: 2rem;
  }
  
  .article-content h2 {
    font-size: 1.75rem;
    padding-left: 0.85rem;
  }
  
  .article-content h3 {
    font-size: 1.35rem;
  }
  
  .article-card {
    padding: 1rem;
  }
  
  .article-card img {
    height: 180px;
  }
  
  .article-card h3 {
    font-size: 1.6rem;
  }
  
  footer {
    padding: 5rem 1rem 2rem;
  }
}

/* 实用工具类 */
.text-center {
  text-align: center;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

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

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

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.rounded-full {
  border-radius: 9999px;
}

.transition-all {
  transition: all 0.3s ease;
}

.hover\:scale-110:hover {
  transform: scale(1.1);
}

.hover\:translate-y-2:hover {
  transform: translateY(-0.5rem);
}

/* 按钮样式 */
button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* 输入框样式 */
input {
  font-family: inherit;
}

/* 图片样式 */
img {
  max-width: 100%;
  height: auto;
}

/* 网格布局 */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .md\:flex-row {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 卡片样式 */
.article-card {
  cursor: pointer;
  background-color: white;
  border: 4px solid var(--color-yellow);
  border-radius: 1.5rem;
  padding: 1rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 10px 10px 0px rgba(255, 140, 0, 0.3);
}

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 1rem;
  border: 2px solid var(--color-bg);
  transition: transform 1s ease;
}

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

/* 搜索栏样式 */
#search-input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 3rem;
  border: 4px solid var(--color-yellow);
  border-radius: 1.5rem;
  outline: none;
  font-size: 0.875rem;
  font-weight: bold;
  color: var(--color-text);
  background-color: white;
  transition: all 0.3s ease;
}

#search-input:focus {
  border-color: var(--color-orange);
}

/* 排序按钮样式 */
.sort-btn {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 9999px;
  border: 2px solid var(--color-yellow);
  background-color: white;
  color: var(--color-text);
  transition: all 0.3s ease;
}

.sort-btn.active {
  background-color: var(--color-orange);
  border-color: var(--color-orange);
  color: white;
}



/* 关于页面样式 */
#about {
  background-color: #F5F2EB;
  padding: 8rem 1.5rem;
}

#about .content {
  max-width: 800px;
  margin: 0 auto;
}

#about h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

#about p {
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
  text-align: justify;
}

/* 标签云样式 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.tag-cloud span {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: white;
  border: 2px solid var(--color-yellow);
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  transition: all 0.3s ease;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.tag-cloud span:hover {
  background-color: var(--color-yellow);
  color: white;
  transform: translateY(-0.25rem);
  box-shadow: 5px 5px 0px rgba(255, 140, 0, 0.2);
  font-weight: 700;
}

/* 博客详情页样式 */
#journal-detail {
  padding: 8rem 1.5rem 4rem;
  background-color: #F5F2EB;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  background-color: white;
  border: 4px solid var(--color-yellow);
  border-radius: 2rem;
  padding: 3rem;
  box-shadow: 10px 10px 0px rgba(93, 64, 55, 0.1);
  line-height: 1.9;
}

.article-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--color-text);
  text-align: center;
}

.article-content h2 {
  font-size: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  color: var(--color-text);
  border-left: 4px solid var(--color-orange);
  padding-left: 1rem;
}

.article-content h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.article-content p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 2;
  text-align: justify;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 2rem 0;
  border: 2px solid var(--color-yellow);
}

.article-content blockquote {
  border-left: 4px solid var(--color-yellow);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--color-text-light);
  font-size: 1.1rem;
}

.article-content pre {
  background-color: #F5F2EB;
  padding: 1.5rem;
  border-radius: 1rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-content code {
  font-family: var(--font-mono);
  background-color: #F5F2EB;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.9rem;
}

.article-content ul, .article-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

/* 响应式调整 */
@media (max-width: 640px) {
  .article-content {
    padding: 1.5rem;
    border-radius: 1rem;
  }
}

/* 横屏模式优化 */
@media (orientation: landscape) {
  .hero {
    height: 100vh;
  }
  
  .article-card img {
    height: 180px;
  }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .article-card img {
    height: 200px;
  }
  
  .article-content {
    padding: 2.5rem 2rem;
  }
}

/* 返回按钮样式 */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: white;
  border: 2px solid var(--color-yellow);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: bold;
  color: var(--color-text);
  transition: all 0.3s ease;
  text-decoration: none;
  margin-bottom: 2rem;
}

.back-btn:hover {
  background-color: var(--color-yellow);
  color: white;
  transform: translateY(-0.25rem);
  box-shadow: 5px 5px 0px rgba(255, 140, 0, 0.2);
}