/* 深色模式样式 */
:root {
  --bg-color: #ffffff;
  --text-color: #34495e;
  --sidebar-bg: #ffffff;
  --sidebar-text: #364149;
  --sidebar-link: #505d6b;
  --sidebar-border: rgba(0,0,0,.07);
  --content-bg: #ffffff;
  --code-bg: #f8f8f8;
  --border-color: #eee;
  --table-border: #ddd;
  --table-row-bg: #f8f8f8;
  --scrollbar-thumb: hsla(0,0%,53.3%,.4);
  --scrollbar-track: hsla(0,0%,53.3%,.1);
}

/* 浅色模式下的引用块样式 */
.markdown-section blockquote {
  color: #505d6b !important;
  border-left: 4px solid #42b983 !important;
  background-color: rgba(66, 185, 131, 0.1) !important;
  margin: 1em 0 !important;
  padding: 0.5em 1em !important;
}

.markdown-section blockquote p {
  color: #505d6b !important;
  margin: 0 !important;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e4e6ea;
  --sidebar-bg: #242424;
  --sidebar-text: #e4e6ea;
  --sidebar-link: #b0b3b8;
  --sidebar-border: rgba(255,255,255,.1);
  --content-bg: #1a1a1a;
  --code-bg: #2d2d2d;
  --border-color: #3a3a3a;
  --table-border: #3a3a3a;
  --table-row-bg: #2d2d2d;
  --scrollbar-thumb: hsla(0,0%,70%,.4);
  --scrollbar-track: hsla(0,0%,70%,.1);
}

/* 应用深色模式变量 */
body {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

.sidebar {
  background-color: var(--sidebar-bg) !important;
  color: var(--sidebar-text) !important;
  border-right: 1px solid var(--sidebar-border) !important;
}

.sidebar ul li a {
  color: var(--sidebar-link) !important;
}

.content {
  background-color: var(--content-bg) !important;
}

.markdown-section {
  background-color: var(--content-bg) !important;
}

.markdown-section code,
.markdown-section pre {
  background-color: var(--code-bg) !important;
}

.markdown-section hr {
  border-bottom: 1px solid var(--border-color) !important;
}

.markdown-section td,
.markdown-section th {
  border: 1px solid var(--table-border) !important;
}

.markdown-section tr:nth-child(2n) {
  background-color: var(--table-row-bg) !important;
}

.sidebar:hover::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb) !important;
}

.sidebar:hover::-webkit-scrollbar-track {
  background: var(--scrollbar-track) !important;
}

/* 深色模式下的sidebar-toggle样式 */
[data-theme="dark"] .sidebar-toggle {
  background-color: rgba(36, 36, 36, 0.9) !important;
  color: #e4e6ea !important;
}

[data-theme="dark"] .sidebar-toggle span {
  background-color: #42b983 !important;
}

/* 深色模式下的标题和链接颜色 */
[data-theme="dark"] .markdown-section h1,
[data-theme="dark"] .markdown-section h2,
[data-theme="dark"] .markdown-section h3,
[data-theme="dark"] .markdown-section h4,
[data-theme="dark"] .markdown-section h5,
[data-theme="dark"] .markdown-section h6 {
  color: #e4e6ea !important;
}

[data-theme="dark"] .markdown-section strong {
  color: #ffffff !important;
}

[data-theme="dark"] .anchor span {
  color: #e4e6ea !important;
}

/* 深色模式下的引用块样式 */
[data-theme="dark"] .markdown-section blockquote {
  color: #b0b3b8 !important;
  border-left: 4px solid #42b983 !important;
  background-color: rgba(66, 185, 131, 0.1) !important;
}

[data-theme="dark"] .markdown-section blockquote p {
  color: #b0b3b8 !important;
}

/* 深色模式下的代码块样式 */
[data-theme="dark"] .markdown-section pre {
  background-color: #2d2d2d !important;
  color: #e4e6ea !important;
  border: 1px solid #3a3a3a !important;
}

[data-theme="dark"] .markdown-section pre code {
  background-color: transparent !important;
  color: #e4e6ea !important;
}

/* 深色模式下的行内代码样式 */
[data-theme="dark"] .markdown-section code {
  background-color: #3a3a3a !important;
  color: #f8f8f2 !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
}

/* 深色模式下的列表样式 */
[data-theme="dark"] .markdown-section ul,
[data-theme="dark"] .markdown-section ol {
  color: #e4e6ea !important;
}

[data-theme="dark"] .markdown-section li {
  color: #e4e6ea !important;
}

/* 深色模式下的段落文本 */
[data-theme="dark"] .markdown-section p {
  color: #e4e6ea !important;
}

/* 深色模式下的链接样式 */
[data-theme="dark"] .markdown-section a {
  color: #58a6ff !important;
}

[data-theme="dark"] .markdown-section a:hover {
  color: #79c0ff !important;
}

/* 主题切换按钮样式 */
.theme-toggle {
  position: fixed;
  top: 10px;
  right: 120px;
  background: var(--sidebar-bg);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  width: 60px;
  height: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 2px;
}

.theme-toggle::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #42b983;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle::before {
  transform: translateX(30px);
  background: #42b983;
}

.theme-toggle:hover {
  opacity: 0.8;
}