/* 现代化配色方案 - 橙黄色作为高光色 */
:root {
  --theme-color: #f97316; /* 主色调：橙色（仅用作高光） */
  --theme-color-light: #fb923c;
  --theme-color-dark: #ea580c;
  --sidebar-bg-color: #ffffff;
  --sidebar-nav-link-color: #4b5563;
  --sidebar-nav-link-hover-color: #f97316;
  --sidebar-nav-link-active-color: #f97316;
  --sidebar-nav-link-active-border-color: #f97316;
  --content-bg-color: #ffffff;
  --heading-color: #1f2937;
  --text-color: #374151;
  --text-color-secondary: #6b7280;
  --border-color: #e5e7eb;
  --code-bg-color: #f3f4f6;
  --blockquote-bg-color: #f9fafb;
  --blockquote-border-color: #f97316;
}

/* 全局样式优化 */
body {
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: -0.005em;
  color: var(--text-color);
  font-weight: 400;
}

/* 优化字体层级 */
:root {
  --font-family-sans: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Cantarell, sans-serif;
  --font-family-mono: 'Ubuntu Mono', 'Consolas', 'Monaco', monospace;
}

/* 标题排版优化 */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-top: 1.8rem;
  margin-bottom: 1.2rem;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1.2rem;
  margin-bottom: 0.8rem;
}

h5, h6 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 1rem;
  margin-bottom: 0.6rem;
}

/* 段落排版优化 */
p {
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  text-align: justify;
  text-justify: inter-word;
}

/* 列表排版优化 */
ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

li > ul, li > ol {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* 代码字体优化 */
pre, code {
  font-family: var(--font-family-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}

pre {
  padding: 1.25rem;
  border-radius: 0.6rem;
}

code {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3rem;
}

/* 引用排版优化 */
blockquote {
  padding: 1.25rem 1.75rem;
  margin: 1.5rem 0;
  border-radius: 0 0.6rem 0.6rem 0;
}

blockquote p {
  font-size: 1.05rem;
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 0;
}

/* 表格排版优化 */
table {
  margin: 1.5rem 0;
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: 0.875rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  font-size: 0.95rem;
}

td {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 侧边栏字体优化 */
.sidebar-nav a {
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400;
}

/* 导航栏字体优化 */
.app-nav a {
  font-size: 0.95rem;
  font-weight: 500;
}

/* 响应式字体调整 */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.7;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.4rem;
  }
  
  p {
    font-size: 1rem;
    line-height: 1.7;
  }
  
  pre, code {
    font-size: 0.85rem;
  }
}

/* 标题边框样式 */
h1 {
  border-bottom: 3px solid var(--theme-color);
  padding-bottom: 0.5rem;
}

h2 {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.4rem;
}

/* 链接样式 */
a {
  color: var(--theme-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--theme-color-dark);
  text-decoration: underline;
}

/* 侧边栏样式 */
.sidebar {
  background-color: var(--sidebar-bg-color);
  border-right: 1px solid var(--border-color);
}

.sidebar-nav {
  padding: 1.5rem 0;
}

.sidebar-nav a {
  color: var(--sidebar-nav-link-color);
  padding: 0.4rem 1.5rem;
  display: block;
  transition: all 0.3s ease;
}

.sidebar-nav a:hover {
  color: var(--sidebar-nav-link-hover-color);
  background-color: rgba(99, 102, 241, 0.05);
}

.sidebar-nav a.active {
  color: var(--sidebar-nav-link-active-color);
  background-color: rgba(99, 102, 241, 0.1);
  border-right: 3px solid var(--sidebar-nav-link-active-border-color);
  font-weight: 500;
}

/* 内容区域样式 */
.content {
  background-color: var(--content-bg-color);
  padding: 2rem;
}

/* 代码块样式 */
pre, code {
  font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

pre {
  background-color: var(--code-bg-color);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

code {
  background-color: var(--code-bg-color);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

/* 引用样式 */
blockquote {
  background-color: var(--blockquote-bg-color);
  border-left: 4px solid var(--blockquote-border-color);
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

blockquote p {
  margin: 0;
  color: var(--text-color-secondary);
}

/* 列表样式 */
ul, ol {
  padding-left: 1.8rem;
  margin: 1rem 0;
}

li {
  margin: 0.5rem 0;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th, td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--sidebar-bg-color);
  font-weight: 600;
  color: var(--heading-color);
}

/* 页脚样式 */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-color-secondary);
  font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .content {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.6rem;
  }
  
  h3 {
    font-size: 1.3rem;
  }
}

/* 动画效果 */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--theme-color-light);
}

/* 进度条样式 */
.progress {
  background-color: var(--theme-color);
  height: 3px;
}

/* 搜索框样式 */
.search {
  margin-bottom: 1.5rem;
}

.search input[type="search"] {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search input[type="search"]:focus {
  outline: none;
  border-color: var(--theme-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 导航栏样式 */
.app-nav {
  margin-right: 2rem;
}

.app-nav a {
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s ease;
}

.app-nav a:hover {
  color: var(--theme-color);
}

.app-nav a.active {
  color: var(--theme-color);
  border-bottom: 2px solid var(--theme-color);
}

/* 加载动画 */
#app {
  font-size: 1.5rem;
  color: var(--text-color-secondary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* 页面元素进入动画 */
.content > * {
  animation: fadeInUp 0.6s ease-out;
}

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

/* 标题进入动画 */
h1, h2, h3, h4, h5, h6 {
  animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 列表项动画 */
ul li, ol li {
  animation: fadeIn 0.4s ease-out;
}

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

/* 悬停效果增强 */
.sidebar-nav li {
  transition: all 0.3s ease;
}

.sidebar-nav li:hover {
  transform: translateX(5px);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 内容区域阴影 */
.content {
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.02);
  border-radius: 0.5rem;
}

/* 卡片悬停效果增强 */
.card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

/* 图片样式与动画 */
img {
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  animation: fadeInImage 0.6s ease-out forwards;
}

img:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

@keyframes fadeInImage {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 按钮点击效果 */
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

/* 代码块复制按钮动画 */
pre:hover .copy-code-button {
  opacity: 1;
  transform: translateY(0);
}

.copy-code-button {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

/* 搜索结果动画 */
.search-result {
  animation: fadeIn 0.3s ease-out;
}

.search-result-item {
  transition: all 0.3s ease;
}

.search-result-item:hover {
  background-color: rgba(99, 102, 241, 0.05);
  transform: translateX(5px);
}

/* 响应式导航动画 */
@media (max-width: 768px) {
  .sidebar-toggle {
    transition: all 0.3s ease;
  }
  
  .sidebar-toggle:hover {
    transform: rotate(15deg);
  }
  
  .sidebar {
    transition: transform 0.3s ease;
  }
}

/* 卡片样式 */
.card {
  background-color: var(--content-bg-color);
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin: 1rem 0;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--theme-color);
  border-radius: 2rem;
  font-size: 0.85rem;
  font-weight: 500;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--theme-color);
  color: white;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--theme-color-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  text-decoration: none;
}

/* 分隔线样式 */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}