/* ============================================
   量子计算系统知识库 - 自定义样式
   ============================================ */

/* ----------------------------
   全局变量
   ---------------------------- */
:root {
  /* 主题色 */
  --qkb-primary: #5E35B1;
  --qkb-primary-light: #9575CD;
  --qkb-secondary: #26A69A;
  --qkb-accent: #7E57C2;

  /* 背景色 */
  --qkb-bg-light: #FAFAFA;
  --qkb-bg-dark: #1E1E2E;

  /* 文字色 */
  --qkb-text-primary: #212121;
  --qkb-text-secondary: #757575;

  /* 渐变色 */
  --qkb-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --qkb-gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --qkb-gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ----------------------------
   深色模式变量
   ---------------------------- */
[data-md-color-scheme="slate"] {
  --qkb-primary: #7E57C2;
  --qkb-primary-light: #B39DDB;
  --qkb-secondary: #80CBC4;
  --qkb-accent: #9575CD;
  --qkb-bg-dark: #1A1A2E;
  --qkb-text-primary: #E0E0E0;
  --qkb-text-secondary: #BDBDBD;
}

/* ----------------------------
   导航栏样式
   ---------------------------- */
.md-header {
  background: var(--qkb-gradient-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.md-header__title {
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ----------------------------
   侧边栏样式
   ---------------------------- */
.md-sidebar {
  border-right: 1px solid rgba(0, 0, 0, 0.07);
}

[data-md-color-scheme="slate"] .md-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.md-nav__item .md-nav__link {
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.md-nav__item .md-nav__link:hover {
  color: var(--qkb-primary);
  transform: translateX(2px);
}

.md-nav__item--active > .md-nav__link {
  color: var(--qkb-primary);
  font-weight: 600;
  border-left: 3px solid var(--qkb-primary);
  padding-left: 0.6rem;
}

/* ----------------------------
   内容区域样式
   ---------------------------- */
.md-content {
  padding-top: 1.5rem;
}

.md-content__inner {
  margin-right: 1rem;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--qkb-primary);
  margin-top: 1.5rem;
}

h1 {
  font-size: 2.2rem;
  border-bottom: 2px solid var(--qkb-primary);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.8rem;
  position: relative;
  padding-left: 1rem;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 4px;
  background: var(--qkb-gradient-primary);
  border-radius: 2px;
}

h3 {
  font-size: 1.4rem;
  color: var(--qkb-accent);
}

/* ----------------------------
   代码块样式
   ---------------------------- */
.highlight {
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.highlighttable {
  border-radius: 8px;
  overflow: hidden;
}

.codehilite {
  background: #F5F5F5;
  padding: 1rem;
  border-radius: 8px;
}

[data-md-color-scheme="slate"] .codehilite {
  background: #2D2D3F;
}

/* 行内代码 */
code {
  background: rgba(94, 53, 177, 0.1);
  color: var(--qkb-primary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* 代码复制按钮 */
.highlight .copy-button {
  background: var(--qkb-primary);
  color: white;
  border: none;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.highlight .copy-button:hover {
  background: var(--qkb-accent);
  transform: scale(1.05);
}

/* ----------------------------
   提示框样式
   ---------------------------- */
.admonition {
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admonition-title {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Info */
.admonition.info {
  border-color: #2196F3;
  background: rgba(33, 150, 243, 0.05);
}

/* Warning */
.admonition.warning {
  border-color: #FF9800;
  background: rgba(255, 152, 0, 0.05);
}

/* Danger */
.admonition.danger {
  border-color: #F44336;
  background: rgba(244, 67, 54, 0.05);
}

/* Success */
.admonition.success {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.05);
}

/* Tip */
.admonition.tip {
  border-color: #00BCD4;
  background: rgba(0, 188, 212, 0.05);
}

/* Note */
.admonition.note {
  border-color: #9C27B0;
  background: rgba(156, 39, 176, 0.05);
}

/* Question */
.admonition.question {
  border-color: #FF5722;
  background: rgba(255, 87, 34, 0.05);
}

/* ----------------------------
   卡片样式
   ---------------------------- */
.qkb-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] .qkb-card {
  background: #252538;
  border-color: rgba(255, 255, 255, 0.05);
}

.qkb-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.qkb-card-header {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--qkb-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qkb-card-body {
  color: var(--qkb-text-secondary);
  line-height: 1.8;
}

/* ----------------------------
   表格样式
   ---------------------------- */
.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 1.5rem 0;
}

.md-typeset table:not([class]) th {
  background: var(--qkb-gradient-primary);
  color: white;
  font-weight: 600;
  padding: 0.8rem 1rem;
}

.md-typeset table:not([class]) td {
  padding: 0.8rem 1rem;
  border-color: rgba(0, 0, 0, 0.05);
}

[data-md-color-scheme="slate"] .md-typeset table:not([class]) td {
  border-color: rgba(255, 255, 255, 0.05);
}

.md-typeset table:not([class]) tr:hover {
  background: rgba(94, 53, 177, 0.05);
}

/* ----------------------------
   链接样式
   ---------------------------- */
.md-content a {
  color: var(--qkb-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.md-content a:hover {
  color: var(--qkb-accent);
  border-bottom-color: var(--qkb-accent);
}

/* ----------------------------
   页脚样式
   ---------------------------- */
.md-footer {
  background: var(--qkb-gradient-primary);
  color: white;
}

.md-footer-meta {
  background: rgba(0, 0, 0, 0.2);
}

.md-footer__inner {
  padding: 1.5rem 0;
}

.md-footer__link {
  color: white;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.md-footer__link:hover {
  opacity: 1;
}

/* ----------------------------
   返回顶部按钮
   ---------------------------- */
.md-top {
  background: var(--qkb-primary);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(94, 53, 177, 0.4);
  transition: all 0.3s ease;
}

.md-top:hover {
  background: var(--qkb-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(94, 53, 177, 0.5);
}

/* ----------------------------
   搜索框样式
   ---------------------------- */
.md-search__form {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.md-search__input {
  background: transparent;
  color: white;
}

.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

/* ----------------------------
   标签页样式
   ---------------------------- */
.tabbed-set {
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tabbed-labels {
  background: rgba(94, 53, 177, 0.1);
  border-bottom: 2px solid var(--qkb-primary);
}

.tabbed-label {
  padding: 0.8rem 1.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tabbed-label:hover {
  background: rgba(94, 53, 177, 0.2);
}

.tabbed-label--active {
  background: var(--qkb-primary);
  color: white;
}

/* ----------------------------
   任务列表样式
   ---------------------------- */
.task-list-control {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
}

.task-list-control .task-list-indicator::before {
  background-color: var(--qkb-primary);
  border-color: var(--qkb-primary);
}

/* ----------------------------
   响应式设计
   ---------------------------- */
@media screen and (max-width: 76.1875em) {
  .md-content {
    padding-left: 0;
  }

  .qkb-card {
    margin: 1rem -0.8rem;
    border-radius: 0;
  }
}

/* ----------------------------
   动画效果
   ---------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.md-content__inner > * {
  animation: fadeIn 0.3s ease-out;
}

/* ----------------------------
   打印样式
   ---------------------------- */
@media print {
  .md-header,
  .md-sidebar,
  .md-footer {
    display: none;
  }

  .md-content {
    margin: 0;
  }
}
