/* 全局样式优化 */
:root {
  --md-primary-fg-color: #673ab7;
  --md-primary-fg-color--light: #9c4dff;
  --md-primary-fg-color--dark: #320b86;
  --md-accent-fg-color: #9c27b0;
  --md-typeset-a-color: #9c27b0;
}

/* 页面布局优化 */
.md-main__inner {
  max-width: none;
}

.md-content {
  max-width: 1400px;
  transition: max-width 0.3s ease-in-out;
}

/* 导航栏美化 */
.md-header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.md-header--shadow {
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

/* 导航标签美化 */
.md-tabs {
  background-color: var(--md-primary-fg-color--dark);
  transition: background-color 0.3s ease-in-out;
}

.md-tabs__link {
  opacity: 0.8;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.md-tabs__link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.md-tabs__link--active {
  opacity: 1;
  font-weight: bold;
}

/* 卡片样式 */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.md-typeset .admonition:hover,
.md-typeset details:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* 代码块美化 */
.md-typeset pre > code {
  border-radius: 8px;
}

.md-typeset code {
  border-radius: 4px;
  padding: 0.2em 0.4em;
}

/* 图片样式优化 */
img[src*="#sequence-diagram"] {
  width: 100%;
  max-width: 1200px;
  height: auto;
  display: block;
  margin: 20px auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

img[src*="#sequence-diagram"]:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* 通用图片样式 */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  transition: transform 0.3s ease-in-out;
}

img:hover {
  transform: scale(1.01);
}

/* 表格美化 */
.md-typeset table:not([class]) {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color--light);
  color: white;
}

.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.03);
}

/* 链接美化 */
.md-typeset a {
  transition: color 0.3s ease-in-out, text-decoration-color 0.3s ease-in-out;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.md-typeset a:hover {
  text-decoration-thickness: 2px;
}

/* 响应式优化 */
@media screen and (max-width: 76.1875em) {
  .md-content {
    max-width: 100%;
  }
  
  .md-sidebar--primary {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
  }
  
  [data-md-color-scheme="slate"] .md-sidebar--primary {
    background-color: rgba(30, 30, 30, 0.95);
  }
}

/* 首页特殊样式 */
.md-typeset h1 {
  font-weight: 700;
  color: var(--md-primary-fg-color);
}

/* 首页卡片布局 */
.feature-card {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
}

.feature-item {
  flex: 1 1 300px;
  padding: 20px;
  border-radius: 8px;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[data-md-color-scheme="slate"] .feature-item {
  background-color: var(--md-code-bg-color);
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.feature-item h3 {
  margin-top: 0;
  color: var(--md-primary-fg-color);
  font-weight: 600;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.md-typeset h1,
.md-typeset h2,
.md-typeset .feature-card {
  animation: fadeIn 0.8s ease-out forwards;
}

.md-typeset h2 {
  animation-delay: 0.2s;
}

.md-typeset .feature-card {
  animation-delay: 0.4s;
}

/* 页脚美化 */
.md-footer {
  background-color: var(--md-primary-fg-color--dark);
}

.md-footer-meta {
  background-color: rgba(0, 0, 0, 0.2);
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

[data-md-color-scheme="slate"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}