/* ==========================================================================
   docs-center — 与站点一致的液态玻璃阅读与编辑界面。

   设计基线取自站点主题：品牌黄、磨砂玻璃表面、20px 圆角、柔和光晕与
   分层阴影；两侧目录为轻玻璃面板，代码块是带窗口按钮的玻璃窗口。
   ========================================================================== */

body.docs-page {
  --dc-brand: var(--brand, #f2a400);
  --dc-brand-rgb: var(--brand-rgb, 242, 164, 0);
  --dc-brand-strong: var(--brand-strong, #8a5a00);
  --dc-brand-soft: var(--brand-soft, rgba(242, 164, 0, 0.12));
  --dc-on-brand: var(--on-brand, #1a1204);
  --dc-canvas: var(--canvas, #f7f8f9);
  --dc-surface: var(--surface, #ffffff);
  --dc-surface-2: var(--surface-2, #fbfbfc);
  --dc-field: var(--field, #ffffff);
  --dc-ink: var(--ink, #0b0d10);
  --dc-ink-2: var(--ink-2, #1d232c);
  --dc-on-ink: var(--on-ink, #ffffff);
  --dc-muted: var(--muted, #5f6773);
  --dc-faint: var(--faint, #767e8a);
  --dc-line: var(--line, #e6e8ec);
  --dc-line-2: var(--line-2, #d5dae1);
  --dc-radius: 20px;
  --dc-radius-sm: 10px;
  --dc-topbar: 60px;
  --dc-shell: 1560px;
  --dc-ease: cubic-bezier(0.22, 0.61, 0.24, 1);
  --dc-fast: cubic-bezier(0.4, 0, 0.2, 1);
  /* 统一动画时长：交互反馈用 1，面板进出用 2 */
  --dc-dur-1: 0.15s;
  --dc-dur-2: 0.2s;
  --dc-glass: var(--glass-surface, rgba(255, 255, 255, 0.62));
  --dc-glass-soft: rgba(255, 255, 255, 0.42);
  --dc-glass-line: var(--lg-rim, rgba(255, 255, 255, 0.72));
  --dc-glass-highlight: var(--lg-top, rgba(255, 255, 255, 0.86));
  --dc-glass-shadow: var(--lg-shadow, 0 24px 48px -30px rgba(15, 23, 42, 0.45));
  --dc-sheen: rgba(255, 255, 255, 0.34);
  --dc-inner-glow: rgba(255, 255, 255, 0.42);
  --dc-shadow-sm: var(--sh-1, 0 1px 2px rgba(11, 13, 16, 0.06));
  --dc-shadow: var(--sh-2, 0 1px 2px rgba(11, 13, 16, 0.05), 0 10px 24px -18px rgba(11, 13, 16, 0.35));
  --dc-shadow-lg: var(--sh-3, 0 1px 2px rgba(11, 13, 16, 0.05), 0 28px 60px -38px rgba(11, 13, 16, 0.45));

  background-color: var(--dc-canvas);
  background-image:
    radial-gradient(1100px 640px at 8% -12%, rgba(var(--dc-brand-rgb), 0.18), transparent 60%),
    radial-gradient(860px 540px at 98% -8%, rgba(96, 165, 250, 0.12), transparent 58%),
    radial-gradient(900px 620px at 50% 112%, rgba(244, 114, 182, 0.06), transparent 60%);
  background-repeat: no-repeat;
  color: var(--dc-ink);
  font-family: var(--font, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

html[data-mode="dark"] body.docs-page,
body.docs-page.dark-mode {
  --dc-glass: var(--glass-surface, rgba(19, 25, 35, 0.66));
  --dc-glass-soft: rgba(19, 25, 35, 0.5);
  --dc-muted: #c2ccd9;
  --dc-faint: #9da9b8;
  --dc-ink: #f5f8fc;
  --dc-sheen: rgba(255, 255, 255, 0.055);
  --dc-inner-glow: rgba(255, 255, 255, 0.05);

  background-image:
    radial-gradient(1100px 640px at 8% -12%, rgba(var(--dc-brand-rgb), 0.16), transparent 62%),
    radial-gradient(860px 540px at 98% -8%, rgba(59, 130, 246, 0.14), transparent 58%),
    radial-gradient(900px 620px at 50% 112%, rgba(244, 114, 182, 0.05), transparent 60%);
}

body.docs-page *,
body.docs-page *::before,
body.docs-page *::after {
  box-sizing: border-box;
}

body.docs-page a {
  color: inherit;
  text-decoration: none;
}

body.docs-page input,
body.docs-page select,
body.docs-page textarea {
  color: inherit;
  font: inherit;
}

body.docs-page button {
  font: inherit;
}

body.docs-page img {
  max-width: 100%;
}

.dc-skip {
  background: var(--dc-brand);
  border-radius: 0 0 8px 0;
  color: var(--dc-on-brand) !important;
  font-size: 0.8rem;
  font-weight: 600;
  left: 0;
  padding: 8px 14px;
  position: fixed;
  top: -60px;
  transition: top 0.2s var(--dc-ease);
  z-index: 200;
}

.dc-skip:focus {
  top: 0;
}

/* ---------- 顶栏：沿用站点 header 的玻璃与下划线 ------------------------ */

.dc-topbar {
  -webkit-backdrop-filter: saturate(var(--lg-saturate, 180%)) blur(var(--lg-blur, 22px));
  backdrop-filter: saturate(var(--lg-saturate, 180%)) blur(var(--lg-blur, 22px));
  background: var(--dc-surface);
  background: var(--lg-header, color-mix(in srgb, var(--dc-surface) 84%, transparent));
  border-bottom: 1px solid var(--lg-line, var(--dc-line));
  position: sticky;
  top: 0;
  z-index: 60;
}

.dc-topbar-inner {
  align-items: center;
  display: flex;
  gap: 16px;
  height: var(--dc-topbar);
  margin: 0 auto;
  max-width: var(--dc-shell);
  padding: 0 32px;
}

.dc-brand {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
  min-width: 0;
}

.dc-brand-logo {
  height: 30px;
  width: auto;
}

.dc-brand-wordmark {
  height: 22px;
  width: auto;
}

.dc-brand-sep {
  background: var(--dc-line-2);
  height: 18px;
  width: 1px;
}

.dc-brand-text {
  background: var(--dc-brand-soft);
  border-radius: 4px;
  color: var(--dc-brand-strong);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 3px 7px;
  white-space: nowrap;
}

.dc-topnav {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  margin-left: 4px;
}

.dc-topnav a {
  align-items: center;
  border-radius: 6px;
  color: var(--dc-muted);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 500;
  height: 34px;
  padding: 0 10px;
  position: relative;
  transition: background-color 0.15s var(--dc-fast), color 0.15s var(--dc-fast);
  white-space: nowrap;
}

.dc-topnav a::after {
  background: var(--dc-brand);
  border-radius: 2px;
  bottom: 3px;
  content: "";
  height: 2px;
  left: 10px;
  position: absolute;
  right: 10px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s var(--dc-ease);
}

.dc-topnav a:hover {
  background: var(--dc-surface-2);
  color: var(--dc-ink);
}

.dc-topnav a.is-active {
  color: var(--dc-ink);
  font-weight: 600;
}

.dc-topnav a:hover::after,
.dc-topnav a.is-active::after {
  transform: scaleX(1);
}

/* ---------- 搜索 -------------------------------------------------------- */

.dc-search {
  flex: 1 1 300px;
  margin-left: 4px;
  max-width: 380px;
  min-width: 170px;
  position: relative;
}

.dc-search-box {
  align-items: center;
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  background: var(--glass-surface, rgba(255, 255, 255, 0.52));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 8px;
  display: flex;
  gap: 9px;
  height: 36px;
  padding: 0 9px 0 11px;
  transition:
    border-color 0.18s var(--dc-fast),
    box-shadow 0.18s var(--dc-fast);
}

.dc-search-box:focus-within {
  border-color: color-mix(in srgb, var(--dc-brand) 52%, var(--dc-line));
  box-shadow: 0 0 0 3px var(--dc-brand-soft);
}

.dc-search-box > i {
  color: var(--dc-muted);
  font-size: 0.76rem;
}

.dc-search-box input {
  background: transparent;
  border: 0;
  flex: 1 1 auto;
  font-size: 0.82rem;
  min-width: 0;
  outline: none;
}

.dc-search-box input::placeholder {
  color: var(--dc-faint);
}

.dc-kbd {
  background: var(--dc-surface);
  border: 1px solid var(--dc-line-2);
  border-radius: 5px;
  color: var(--dc-ink);
  font-family: inherit;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  white-space: nowrap;
}

.dc-search-panel {
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  background: var(--lg-sheet-raised, linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.72)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 12px;
  box-shadow: var(--lg-shadow-lift, var(--dc-shadow-lg));
  left: 0;
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 95;
}

.dc-search-panel[hidden] {
  display: none;
}

.dc-search-hint,
.dc-search-empty {
  color: var(--dc-muted);
  font-size: 0.78rem;
  padding: 12px;
}

.dc-search-item {
  border-radius: 8px;
  display: block;
  padding: 9px 11px;
  transition: background-color 0.15s var(--dc-fast);
}

.dc-search-item:hover,
.dc-search-item.is-active {
  background: var(--dc-brand-soft);
}

.dc-search-item strong {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-search-item span {
  color: var(--dc-muted);
  display: block;
  font-size: 0.72rem;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-search-all {
  border-top: 1px solid var(--dc-line);
  color: var(--dc-brand-strong);
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 10px 12px 6px;
}

/* ---------- 顶栏右侧 ---------------------------------------------------- */

.dc-top-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  margin-left: auto;
}

.dc-user,
.dc-login {
  border-radius: 6px;
  color: var(--dc-ink-2);
  font-size: 0.78rem;
  font-weight: 500;
  max-width: 130px;
  overflow: hidden;
  padding: 7px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-user:hover,
.dc-login:hover {
  background: var(--dc-surface-2);
  color: var(--dc-ink);
}

.dc-user {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  gap: 7px;
  justify-content: center;
  max-width: 170px;
  min-height: 34px;
  min-width: 34px;
  padding: 4px 8px 4px 4px;
}

.dc-user span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dc-avatar {
  background: var(--dc-surface-2);
  border: 1px solid var(--dc-line);
  border-radius: 8px;
  flex: 0 0 auto;
  height: 26px;
  object-fit: cover;
  width: 26px;
}

/* 未上传皮肤时用图标占位，保证按钮尺寸稳定，菜单不会压到头像位置。 */
.dc-avatar-fallback {
  align-items: center;
  color: var(--dc-muted);
  display: inline-flex;
  font-size: 0.7rem;
  justify-content: center;
  line-height: 1;
}

/* ---------- 用户下拉菜单 ------------------------------------------------ */

.dc-user-menu {
  align-items: center;
  display: flex;
  position: relative;
}

.dc-user-caret {
  flex: 0 0 auto;
  font-size: 0.6rem;
  opacity: 0.55;
  transition: transform var(--dc-dur-1) var(--dc-ease);
}

.dc-user-menu.show .dc-user-caret {
  transform: rotate(180deg);
}

/* 文档中心内的下拉面板统一用淡入。注意：Bootstrap 会由 Popper 写入
   transform 定位，动画若再改 transform 会把面板拽回容器原点，所以这里
   只做不透明度过渡。 */
body.docs-page .dropdown-menu.show {
  animation: dc-menu-fade var(--dc-dur-2) var(--dc-ease);
}

.dc-user-menu .dc-user-dropdown.show {
  animation: dc-menu-fade var(--dc-dur-2) var(--dc-ease);
}

@keyframes dc-menu-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.dc-user-menu .dc-user-dropdown {
  background: var(--dc-surface);
  border: 1px solid var(--dc-line);
  border-radius: 10px;
  box-shadow: 0 18px 44px -22px rgba(15, 23, 42, 0.45);
  font-size: 0.82rem;
  min-width: 176px;
  padding: 6px;
  z-index: 1200;
}

.dc-user-menu .dc-user-dropdown .dropdown-item {
  border-radius: 6px;
  color: var(--dc-ink-2);
  padding: 7px 10px;
}

.dc-user-menu .dc-user-dropdown .dropdown-item:hover,
.dc-user-menu .dc-user-dropdown .dropdown-item:focus {
  background: var(--dc-surface-2);
  color: var(--dc-ink);
  text-decoration: none;
}

.dc-user-menu .dc-user-dropdown .dropdown-divider {
  border-top-color: var(--dc-line-2);
  margin: 5px 2px;
}

.dc-user-menu .dc-user-dropdown .dc-user-logout {
  color: #d9534f;
  text-align: left;
}

.dc-user-menu .dc-user-dropdown .dc-user-logout:hover,
.dc-user-menu .dc-user-dropdown .dc-user-logout:focus {
  background: rgba(217, 83, 79, 0.12);
  color: #c9302c;
}

.dc-icon-btn {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--dc-ink-2);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.86rem;
  height: 34px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition:
    background-color 0.15s var(--dc-fast),
    color 0.15s var(--dc-fast),
    transform 0.16s var(--dc-ease);
  width: 34px;
}

.dc-icon-btn:hover {
  background: var(--dc-surface-2);
  color: var(--dc-ink);
}

.dc-icon-btn:active {
  transform: scale(0.94);
}

.dc-menu-btn,
.dc-search-toggle,
.dc-toc-btn,
.dc-nav-close,
.dc-toc-close {
  display: none;
}

#dc-theme-toggle i {
  transition: transform 0.4s var(--dc-ease);
}

body.docs-page.is-dark #dc-theme-toggle i {
  transform: rotate(180deg);
}

/* ---------- 栅格 -------------------------------------------------------- */

.dc-shell {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: 260px minmax(0, 1fr) 244px;
  margin: 0 auto;
  max-width: var(--dc-shell);
  padding: 26px 32px 80px;
}

.dc-shell--wide {
  grid-template-columns: 260px minmax(0, 1fr);
}

.dc-main {
  min-width: 0;
}

/* ---------- 左侧目录 ---------------------------------------------------- */

.dc-nav,
.dc-toc {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: calc(100vh - var(--dc-topbar) - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0;
  position: sticky;
  scrollbar-color: var(--dc-line-2) transparent;
  scrollbar-width: thin;
  top: calc(var(--dc-topbar) + 18px);
}

.dc-nav::-webkit-scrollbar,
.dc-toc::-webkit-scrollbar,
.dc-search-panel::-webkit-scrollbar,
.dc-content pre::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.dc-nav::-webkit-scrollbar-thumb,
.dc-toc::-webkit-scrollbar-thumb,
.dc-search-panel::-webkit-scrollbar-thumb {
  background: var(--dc-line-2);
  border-radius: 999px;
}

.dc-nav-head,
.dc-toc-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 0 10px 8px;
}

.dc-nav-eyebrow,
.dc-toc-head > span {
  color: var(--dc-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dc-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dc-nav-group {
  margin-bottom: 14px;
}

.dc-nav-title {
  align-items: center;
  border-radius: 8px;
  color: var(--dc-ink);
  display: flex;
  font-size: 0.88rem;
  font-weight: 680;
  gap: 9px;
  letter-spacing: -0.01em;
  padding: 7px 10px 7px 8px;
  position: relative;
  transition: background-color 0.15s var(--dc-fast), color 0.15s var(--dc-fast);
}

.dc-nav-badge {
  background: var(--dc-brand);
  border-radius: 2px;
  flex: 0 0 auto;
  height: 6px;
  opacity: 0.9;
  transform: rotate(45deg);
  transition:
    box-shadow 0.18s var(--dc-fast),
    opacity 0.18s var(--dc-fast);
  width: 6px;
}

.dc-nav-title-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-nav-title.is-active .dc-nav-badge {
  box-shadow: 0 0 0 3px var(--dc-brand-soft);
  opacity: 1;
}

.dc-nav-title:hover {
  background: var(--dc-surface-2);
}

.dc-nav-children {
  border-left: 1px solid var(--dc-line);
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 0 11px;
  padding-left: 7px;
}

.dc-nav-link {
  border-radius: 7px;
  color: var(--dc-muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.45;
  overflow: hidden;
  padding: 6px 10px 6px 14px;
  position: relative;
  text-overflow: ellipsis;
  transition:
    background-color 0.15s var(--dc-fast),
    color 0.15s var(--dc-fast);
  white-space: nowrap;
}

.dc-nav-link::before {
  background: var(--dc-line-2);
  border-radius: 50%;
  content: "";
  height: 3px;
  left: 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition:
    background-color 0.15s var(--dc-fast),
    transform 0.15s var(--dc-fast);
  width: 3px;
}

.dc-nav-link:hover::before,
.dc-nav-link.is-active::before {
  background: var(--dc-brand);
  transform: translateY(-50%) scale(1.4);
}

.dc-nav-link--top {
  align-items: center;
  color: var(--dc-ink);
  display: flex;
  font-size: 0.88rem;
  font-weight: 660;
  gap: 9px;
  margin-left: 0;
  padding: 7px 10px 7px 8px;
}

.dc-nav-link--top::before {
  display: none;
}

.dc-nav-link--top.is-active .dc-nav-badge {
  box-shadow: 0 0 0 3px var(--dc-brand-soft);
  opacity: 1;
}

.dc-nav-link:hover {
  background: var(--dc-surface-2);
  color: var(--dc-ink);
}

.dc-nav-link.is-active,
.dc-nav-title.is-active {
  background: var(--dc-brand-soft);
  box-shadow: none;
  color: var(--dc-brand-strong);
  font-weight: 650;
}

.dc-nav-title.is-active,
.dc-nav-link--top.is-active {
  font-weight: 700;
}

.dc-nav-foot {
  margin-top: 10px;
  padding: 10px 10px 2px;
}

.dc-nav-foot a {
  color: var(--dc-muted);
  font-size: 0.8rem;
}

.dc-nav-foot a:hover {
  color: var(--dc-brand-strong);
}

/* ---------- 右侧页内目录 ------------------------------------------------ */

.dc-toc {
  padding: 2px 0 0 2px;
}

.dc-toc-head {
  padding: 0 10px 8px 12px;
}

.dc-toc-head > span {
  color: var(--dc-ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.dc-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dc-toc-item a {
  border-left: 0;
  border-radius: 8px;
  color: var(--dc-muted);
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
  padding: 6px 10px;
  transition:
    background-color 0.15s var(--dc-fast),
    color 0.15s var(--dc-fast);
}

.dc-toc-lv2 a {
  color: var(--dc-ink);
  font-size: 0.88rem;
  font-weight: 660;
  letter-spacing: -0.005em;
  line-height: 1.4;
}

.dc-toc-item.dc-toc-lv2 {
  margin-top: 2px;
}

.dc-toc-lv3 a {
  color: var(--dc-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding-left: 24px;
}

.dc-toc-item a:hover {
  background: var(--dc-surface-2);
  color: var(--dc-ink);
}

.dc-toc-item.is-active a {
  background: linear-gradient(90deg, var(--dc-brand-soft), transparent 88%);
  border-radius: 8px;
  color: var(--dc-brand-strong);
  font-weight: 700;
}

.dc-toc-empty {
  color: var(--dc-faint);
  font-size: 0.75rem;
  padding: 4px 8px 10px;
}

/* ---------- 正文 -------------------------------------------------------- */

.dc-crumbs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 2px 12px;
  min-width: 0;
}

.dc-crumbs a,
.dc-crumb-sep,
.dc-crumb-current {
  color: var(--dc-muted);
  font-size: 0.75rem;
}

.dc-crumbs a:hover {
  color: var(--dc-brand-strong);
}

.dc-crumb-current {
  color: var(--dc-ink);
  font-weight: 500;
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-article {
  -webkit-backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  animation: dc-rise 0.36s var(--dc-ease) both;
  backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  background:
    linear-gradient(150deg, var(--dc-sheen), transparent 46%),
    var(--lg-sheet, linear-gradient(150deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.58)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    inset 0 -28px 46px -40px var(--dc-inner-glow),
    var(--lg-shadow, var(--dc-glass-shadow));
  min-height: 60vh;
  padding: 38px 46px 46px;
}

.dc-article-head {
  border-bottom: 1px solid var(--dc-line);
  margin-bottom: 26px;
  padding-bottom: 20px;
}

.dc-article-kicker {
  align-items: center;
  color: var(--dc-faint);
  display: flex;
  font-size: 0.66rem;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dc-dot {
  background: var(--dc-brand);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--dc-brand-soft);
  height: 6px;
  width: 6px;
}

.dc-article h1 {
  font-size: 1.9rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.28;
  margin: 10px 0 12px;
  overflow-wrap: anywhere;
}

.dc-article-subtitle {
  color: var(--dc-muted);
  font-size: 1.02rem;
  font-weight: 450;
  line-height: 1.65;
  margin: -4px 0 14px;
  max-width: 62ch;
  overflow-wrap: anywhere;
}

.dc-meta {
  align-items: center;
  color: var(--dc-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 12px 16px;
}

.dc-author {
  align-items: center;
  background: var(--dc-surface-2);
  border: 1px solid var(--dc-line);
  border-radius: 999px;
  color: var(--dc-ink);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 7px;
  padding: 3px 12px 3px 4px;
  transition:
    border-color 0.16s var(--dc-fast),
    background-color 0.16s var(--dc-fast),
    color 0.16s var(--dc-fast);
}

.dc-author:hover {
  background: var(--dc-surface);
  border-color: color-mix(in srgb, var(--dc-brand) 46%, var(--dc-line));
  color: var(--dc-brand-strong);
}

.dc-author-avatar {
  background: var(--dc-surface);
  border-radius: 50%;
  display: block;
  flex: 0 0 auto;
  height: 24px;
  object-fit: cover;
  width: 24px;
}

.dc-author-name {
  line-height: 1.4;
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dc-meta i {
  margin-right: 5px;
}

.dc-meta-link {
  color: var(--dc-brand-strong) !important;
  font-weight: 600;
}

.dc-content {
  color: var(--dc-ink);
  font-size: 0.95rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.dc-content > :first-child {
  margin-top: 0;
}

.dc-content > :last-child {
  margin-bottom: 0;
}

.dc-content p {
  margin: 0 0 1.05em;
}

.dc-content h2,
.dc-content h3,
.dc-content h4 {
  letter-spacing: -0.015em;
  line-height: 1.35;
  scroll-margin-top: calc(var(--dc-topbar) + 24px);
}

.dc-content h2 {
  border-top: 1px solid var(--dc-line);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2em 0 0.8em;
  padding-top: 1em;
}

.dc-content h3 {
  font-size: 1.12rem;
  font-weight: 650;
  margin: 1.7em 0 0.6em;
}

.dc-content h4 {
  font-size: 0.98rem;
  font-weight: 650;
  margin: 1.4em 0 0.5em;
}

.dc-anchor {
  color: var(--dc-brand);
  font-weight: 500;
  margin-left: 8px;
  opacity: 0;
  text-decoration: none;
  transition: opacity 0.15s var(--dc-fast);
}

.dc-content h2:hover .dc-anchor,
.dc-content h3:hover .dc-anchor,
.dc-anchor:focus {
  opacity: 0.75;
}

.dc-content a {
  color: var(--dc-brand-strong);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--dc-brand) 34%, transparent);
  text-underline-offset: 3px;
}

.dc-content a:hover {
  text-decoration-color: currentColor;
}

.dc-content strong {
  font-weight: 650;
}

.dc-content ul,
.dc-content ol {
  margin: 0 0 1.05em;
  padding-left: 1.45em;
}

.dc-content li {
  margin: 0.28em 0;
}

.dc-content li::marker {
  color: var(--dc-faint);
}

.dc-content blockquote {
  background: rgba(var(--dc-brand-rgb), 0.07);
  border-left: 3px solid var(--dc-brand);
  border-radius: 0 8px 8px 0;
  color: var(--dc-ink);
  margin: 1.2em 0;
  padding: 12px 16px;
}

.dc-content blockquote > :last-child {
  margin-bottom: 0;
}

.dc-content code {
  background: var(--dc-surface-2);
  border: 1px solid var(--dc-line);
  border-radius: 5px;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, monospace);
  font-size: 0.86em;
  padding: 0.12em 0.38em;
}

.dc-content pre {
  -webkit-backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  background:
    linear-gradient(150deg, var(--dc-sheen), transparent 46%),
    var(--lg-sheet-raised, linear-gradient(150deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.42)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    inset 0 -22px 38px -34px var(--dc-inner-glow),
    var(--lg-shadow, var(--dc-glass-shadow));
  color: var(--dc-ink);
  line-height: 1.7;
  margin: 1.2em 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.dc-code-head {
  align-items: center;
  background: var(--lg-header, rgba(255, 255, 255, 0.34));
  border-bottom: 1px solid var(--lg-line, rgba(15, 23, 42, 0.07));
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  padding: 8px 10px 8px 12px;
}

.dc-code-dots {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.dc-code-dot {
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  display: block;
  height: 10px;
  width: 10px;
}

.dc-code-dot--red {
  background: #ff5f57;
}

.dc-code-dot--yellow {
  background: #febc2e;
}

.dc-code-dot--green {
  background: #28c840;
}

.dc-code-lang {
  color: var(--dc-muted);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, monospace);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.dc-content pre code {
  background: transparent;
  border: 0;
  color: var(--dc-ink);
  display: block;
  font-size: 0.85rem;
  line-height: 1.75;
  overflow-x: auto;
  padding: 16px 18px;
}

.dc-copy {
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--dc-glass-line);
  border-radius: 6px;
  color: var(--dc-muted);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 0.68rem;
  margin-left: auto;
  padding: 4px 9px;
  transition:
    background-color 0.15s var(--dc-fast),
    border-color 0.15s var(--dc-fast),
    color 0.15s var(--dc-fast);
}

html[data-mode="dark"] .dc-copy,
body.docs-page.dark-mode .dc-copy {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.dc-copy:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--dc-line-2);
  color: var(--dc-ink);
}

html[data-mode="dark"] .dc-copy:hover,
body.docs-page.dark-mode .dc-copy:hover {
  background: rgba(255, 255, 255, 0.14);
}

.dc-content table {
  border: 1px solid var(--dc-line);
  border-collapse: separate;
  border-radius: 10px;
  border-spacing: 0;
  display: block;
  margin: 1.2em 0;
  max-width: 100%;
  overflow-x: auto;
  width: 100%;
}

.dc-content th,
.dc-content td {
  border-bottom: 1px solid var(--dc-line);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.dc-content th {
  background: var(--dc-surface-2);
  font-size: 0.8rem;
  font-weight: 650;
}

.dc-content tr:last-child td {
  border-bottom: 0;
}

.dc-content img {
  border: 1px solid var(--dc-line);
  border-radius: 12px;
  display: block;
  height: auto;
  margin: 1.2em 0;
}

.dc-content hr {
  border: 0;
  border-top: 1px solid var(--dc-line);
  margin: 2em 0;
}

/* ---------- 上一篇 / 下一篇 -------------------------------------------- */

.dc-pager {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
}

.dc-pager-link {
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  backdrop-filter: blur(18px) saturate(165%);
  background: var(--lg-sheet, linear-gradient(150deg, var(--dc-glass), var(--dc-glass-soft)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    var(--lg-shadow, var(--dc-shadow-sm));
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  transition:
    transform 0.2s var(--dc-ease),
    box-shadow 0.2s var(--dc-ease),
    border-color 0.2s var(--dc-ease);
}

.dc-pager-link:hover {
  border-color: var(--dc-line-2);
  box-shadow: var(--dc-shadow);
  transform: translateY(-2px);
}

.dc-pager-next {
  text-align: right;
}

.dc-pager-label {
  color: var(--dc-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dc-pager-title {
  color: var(--dc-ink);
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 按钮 -------------------------------------------------------- */

.dc-btn {
  align-items: center;
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  background: var(--lg-sheet, linear-gradient(150deg, var(--dc-glass), var(--dc-glass-soft)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    var(--lg-shadow, var(--dc-shadow-sm));
  color: var(--dc-ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 600;
  gap: 7px;
  height: 36px;
  justify-content: center;
  overflow: hidden;
  padding: 0 15px;
  position: relative;
  transition:
    background-color 0.15s var(--dc-fast),
    border-color 0.15s var(--dc-fast),
    box-shadow 0.15s var(--dc-fast),
    transform 0.16s var(--dc-ease);
  user-select: none;
}

.dc-btn:hover {
  background: var(--lg-sheet-raised, var(--dc-surface-2));
  border-color: var(--lg-rim-hover, var(--dc-line-2));
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    var(--lg-shadow, var(--dc-shadow));
  transform: translateY(-1px);
}

.dc-btn:active {
  transform: scale(0.97);
}

.dc-btn:focus-visible,
.dc-icon-btn:focus-visible,
.dc-nav-link:focus-visible,
.dc-nav-title:focus-visible,
.dc-tool:focus-visible,
.dc-tab:focus-visible {
  outline: 2px solid var(--dc-brand);
  outline-offset: 2px;
}

.dc-btn-primary {
  background: var(--dc-ink);
  border-color: var(--dc-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    var(--dc-shadow-sm);
  color: #ffffff;
  flex: 0 0 auto;
}

.dc-btn-primary:hover {
  background: var(--dc-ink-2);
  border-color: var(--dc-ink-2);
  color: #ffffff;
  filter: none;
}

html[data-mode="dark"] .dc-btn-primary,
body.docs-page.dark-mode .dc-btn-primary,
html[data-mode="dark"] .dc-btn-primary:hover,
body.docs-page.dark-mode .dc-btn-primary:hover {
  color: #0b0d10;
}

.dc-btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.dc-btn-ghost:hover {
  background: var(--dc-surface-2);
  border-color: transparent;
  box-shadow: none;
}

.dc-btn-danger {
  background: var(--danger, #c0362c);
  border-color: color-mix(in srgb, var(--danger, #c0362c) 78%, #0b0d10);
  color: #fff;
}

.dc-btn-danger:hover {
  background: var(--danger, #c0362c);
  color: #fff;
  filter: brightness(1.06);
}

.dc-btn-sm {
  border-radius: 7px;
  font-size: 0.73rem;
  height: 30px;
  padding: 0 10px;
}

.dc-btn-block {
  width: 100%;
}

.dc-pager-link,
.dc-result {
  overflow: hidden;
  position: relative;
}

.dc-btn::after,
.dc-pager-link::after,
.dc-result::after {
  background: linear-gradient(
    110deg,
    transparent 34%,
    var(--dc-sheen) 50%,
    transparent 66%
  );
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(-130%);
  transition:
    opacity 0.3s var(--dc-fast),
    transform 0.62s var(--dc-ease);
}

.dc-btn:hover::after,
.dc-pager-link:hover::after,
.dc-result:hover::after {
  opacity: 0.9;
  transform: translateX(130%);
}

.dc-ripple {
  animation: dc-ripple 0.5s ease-out forwards;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.2;
  pointer-events: none;
  position: absolute;
  transform: scale(0);
}

@keyframes dc-ripple {
  to {
    opacity: 0;
    transform: scale(2.6);
  }
}

/* ---------- 搜索页 ------------------------------------------------------ */

.dc-search-hero {
  -webkit-backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  animation: dc-rise 0.34s var(--dc-ease) both;
  backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  background: var(--lg-sheet, linear-gradient(150deg, var(--dc-glass), var(--dc-glass-soft)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    var(--lg-shadow, var(--dc-glass-shadow));
  padding: 26px 28px;
}

.dc-eyebrow {
  color: var(--dc-faint);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dc-search-hero h1 {
  font-size: 1.6rem;
  font-weight: 720;
  letter-spacing: -0.025em;
  margin: 8px 0 8px;
}

.dc-search-hero p {
  color: var(--dc-muted);
  font-size: 0.82rem;
  margin: 0 0 16px;
}

.dc-search-hero-form {
  align-items: center;
  background: var(--dc-field);
  border: 1px solid var(--dc-line);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 5px 5px 5px 13px;
  transition: border-color 0.18s var(--dc-fast), box-shadow 0.18s var(--dc-fast);
}

.dc-search-hero-form:focus-within {
  border-color: color-mix(in srgb, var(--dc-brand) 52%, var(--dc-line));
  box-shadow: 0 0 0 3px var(--dc-brand-soft);
}

.dc-search-hero-form > i {
  color: var(--dc-muted);
}

.dc-search-hero-form input {
  background: transparent;
  border: 0;
  flex: 1 1 auto;
  font-size: 0.86rem;
  min-width: 0;
  outline: none;
}

.dc-result-count {
  color: var(--dc-muted);
  font-size: 0.78rem;
  margin: 18px 4px 10px;
}

.dc-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dc-result {
  -webkit-backdrop-filter: blur(16px) saturate(165%);
  backdrop-filter: blur(16px) saturate(165%);
  background: var(--lg-sheet, linear-gradient(150deg, var(--dc-glass), var(--dc-glass-soft)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    var(--lg-shadow, var(--dc-shadow-sm));
  display: block;
  padding: 20px 24px;
  transition:
    transform 0.2s var(--dc-ease),
    box-shadow 0.2s var(--dc-ease),
    border-color 0.2s var(--dc-ease);
}

.dc-result:hover {
  border-color: var(--dc-line-2);
  box-shadow: var(--dc-shadow);
  transform: translateY(-2px);
}

.dc-result h2 {
  color: var(--dc-ink);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.4;
  margin: 0 0 4px;
}

.dc-result-subtitle {
  color: var(--dc-muted);
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0 0 7px;
}

.dc-result-excerpt {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--dc-ink);
  display: -webkit-box;
  font-size: 0.86rem;
  line-height: 1.7;
  margin: 0 0 10px;
  opacity: 0.86;
  overflow: hidden;
}

.dc-result-meta {
  align-items: center;
  color: var(--dc-faint);
  display: flex;
  font-size: 0.72rem;
  gap: 10px;
  justify-content: space-between;
}

.dc-result-open {
  color: var(--dc-brand-strong);
  font-weight: 600;
  opacity: 0.78;
  transition: opacity 0.2s var(--dc-ease);
}

.dc-result:hover .dc-result-open {
  opacity: 1;
}

/* ---------- 空状态 ------------------------------------------------------ */

.dc-empty {
  color: var(--dc-muted);
  padding: 46px 16px;
  text-align: center;
}

.dc-empty > i {
  color: var(--dc-faint);
  display: block;
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.dc-empty h1 {
  color: var(--dc-ink);
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.dc-empty p {
  margin: 0 0 16px;
}

/* ---------- 后台外壳 ---------------------------------------------------- */

.dc-admin-page .dc-toc-btn,
.dc-admin-page .dc-toc {
  display: none;
}

.dc-admin {
  margin: 0 auto;
  max-width: 1400px;
  padding: 26px 24px 80px;
}

.dc-admin-head {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dc-admin-head h1 {
  font-size: 1.5rem;
  font-weight: 720;
  letter-spacing: -0.025em;
  margin: 6px 0 0;
}

.dc-admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dc-panel {
  -webkit-backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
  background:
    linear-gradient(150deg, var(--dc-sheen), transparent 46%),
    var(--lg-sheet-raised, linear-gradient(150deg, var(--dc-glass), var(--dc-glass-soft)));
  border: 1px solid var(--lg-rim, var(--dc-glass-line));
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 var(--lg-top, var(--dc-glass-highlight)),
    inset 0 -24px 40px -36px var(--dc-inner-glow),
    var(--lg-shadow, var(--dc-glass-shadow));
  padding: 20px;
}

.dc-table-panel {
  padding: 6px 18px 14px;
}

.dc-table-wrap {
  overflow-x: auto;
}

.dc-table {
  border-collapse: collapse;
  font-size: 0.8rem;
  width: 100%;
}

.dc-table th {
  color: var(--dc-faint);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 14px 10px 10px;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.dc-table td {
  border-top: 1px solid var(--dc-line);
  padding: 11px 10px;
  vertical-align: middle;
}

.dc-table tbody tr {
  transition: background-color 0.15s var(--dc-fast);
}

.dc-table tbody tr:hover {
  background: var(--dc-surface-2);
}

.dc-table-title {
  color: var(--dc-ink);
  font-weight: 600;
}

.dc-table-title:hover {
  color: var(--dc-brand-strong);
}

.dc-table code {
  background: var(--dc-surface-2);
  border: 1px solid var(--dc-line);
  border-radius: 4px;
  font-size: 0.72rem;
  padding: 1px 5px;
}

.dc-muted {
  color: var(--dc-muted);
}

.dc-table-actions {
  text-align: right;
  white-space: nowrap;
}

.dc-inline-form {
  display: inline-block;
  margin: 0;
}

.dc-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 3px 9px;
}

.dc-badge-live {
  background: rgba(15, 125, 85, 0.12);
  color: var(--success, #0f7d55);
}

.dc-badge-draft {
  background: rgba(var(--dc-brand-rgb), 0.16);
  color: var(--dc-brand-strong);
}

.dc-alert {
  align-items: center;
  border-radius: 10px;
  display: flex;
  font-size: 0.8rem;
  gap: 9px;
  margin-bottom: 16px;
  padding: 11px 15px;
}

.dc-alert-ok {
  background: rgba(15, 125, 85, 0.1);
  border: 1px solid rgba(15, 125, 85, 0.24);
  color: var(--success, #0f7d55);
}

.dc-alert-error {
  background: rgba(192, 54, 44, 0.09);
  border: 1px solid rgba(192, 54, 44, 0.24);
  color: var(--danger, #c0362c);
}

/* ---------- 后台表单 ---------------------------------------------------- */

.dc-form-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.dc-form-main,
.dc-form-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.dc-form-side {
  position: sticky;
  top: calc(var(--dc-topbar) + 18px);
}

.dc-title-panel {
  padding: 18px;
}

.dc-field {
  display: block;
  margin-bottom: 14px;
}

.dc-field:last-child {
  margin-bottom: 0;
}

.dc-label {
  color: var(--dc-muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.dc-input {
  background: var(--dc-field);
  border: 1px solid var(--dc-line);
  border-radius: 8px;
  font-size: 0.82rem;
  height: 38px;
  outline: none;
  padding: 0 11px;
  transition: border-color 0.15s var(--dc-fast), box-shadow 0.15s var(--dc-fast);
  width: 100%;
}

.dc-input:focus {
  border-color: color-mix(in srgb, var(--dc-brand) 52%, var(--dc-line));
  box-shadow: 0 0 0 3px var(--dc-brand-soft);
}

.dc-input-lg {
  font-size: 1.12rem;
  font-weight: 650;
  height: 46px;
  letter-spacing: -0.015em;
}

.dc-slug {
  align-items: center;
  display: flex;
}

.dc-slug-prefix {
  background: var(--dc-surface-2);
  border: 1px solid var(--dc-line);
  border-radius: 8px 0 0 8px;
  color: var(--dc-faint);
  font-size: 0.76rem;
  height: 38px;
  line-height: 36px;
  padding: 0 9px;
  white-space: nowrap;
}

.dc-slug .dc-input {
  border-radius: 0 8px 8px 0;
}

.dc-hint {
  color: var(--dc-faint);
  display: block;
  font-size: 0.68rem;
  line-height: 1.5;
  margin-top: 5px;
}

.dc-field-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.dc-side-panel {
  padding: 18px;
}

.dc-side-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.dc-help-list {
  color: var(--dc-muted);
  font-size: 0.74rem;
  line-height: 1.8;
  margin: 0;
  padding-left: 1.1em;
}

.dc-help-list code {
  background: var(--dc-surface-2);
  border-radius: 4px;
  font-size: 0.9em;
  padding: 1px 4px;
}

.dc-danger-zone {
  align-items: center;
  background: rgba(192, 54, 44, 0.05);
  border: 1px solid rgba(192, 54, 44, 0.2);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin-top: 22px;
  padding: 16px 20px;
}

.dc-danger-zone strong {
  font-size: 0.84rem;
}

.dc-danger-zone p {
  color: var(--dc-muted);
  font-size: 0.74rem;
  margin: 4px 0 0;
}

/* ---------- 编辑器 ------------------------------------------------------ */

.dc-editor-panel {
  overflow: hidden;
  padding: 0;
}

.dc-editor {
  display: flex;
  flex-direction: column;
}

.dc-editor-bar {
  align-items: center;
  background: var(--dc-surface-2);
  border-bottom: 1px solid var(--dc-line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 7px 10px;
}

.dc-editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.dc-tool {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--dc-ink-2);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.72rem;
  height: 30px;
  justify-content: center;
  transition: background-color 0.15s var(--dc-fast), color 0.15s var(--dc-fast);
  width: 30px;
}

.dc-tool:hover {
  background: var(--dc-surface);
  color: var(--dc-ink);
}

.dc-tool:active {
  transform: scale(0.94);
}

.dc-editor-tabs {
  display: none;
  gap: 2px;
}

.dc-tab {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--dc-ink-2);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 10px;
}

.dc-tab.is-active {
  background: var(--dc-surface);
  box-shadow: var(--dc-shadow-sm);
  color: var(--dc-ink);
}

.dc-editor-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
}

.dc-editor-pane {
  min-width: 0;
}

.dc-editor-write {
  display: flex;
}

.dc-editor-write textarea {
  background: transparent;
  border: 0;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, monospace);
  font-size: 0.84rem;
  height: 100%;
  line-height: 1.75;
  min-height: 520px;
  outline: none;
  padding: 18px;
  resize: none;
  tab-size: 2;
  width: 100%;
}

.dc-editor-preview {
  border-left: 1px solid var(--dc-line);
  max-height: 720px;
  overflow-y: auto;
  padding: 18px;
}

.dc-preview-hint {
  color: var(--dc-faint) !important;
}

.dc-editor-status {
  align-items: center;
  border-top: 1px solid var(--dc-line);
  color: var(--dc-faint);
  display: flex;
  font-size: 0.68rem;
  gap: 14px;
  padding: 8px 14px;
}

.dc-editor-hint {
  margin-left: auto;
}

.dc-draft {
  align-items: center;
  background: rgba(var(--dc-brand-rgb), 0.1);
  border: 1px solid rgba(var(--dc-brand-rgb), 0.3);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 14px;
}

.dc-draft[hidden] {
  display: none;
}

.dc-draft span {
  margin-right: auto;
}

/* ---------- 历史版本 ---------------------------------------------------- */

.dc-history-head {
  align-items: flex-end;
  border-bottom: 1px solid var(--dc-line);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 14px;
}

.dc-history-head h2 {
  font-size: 1.05rem;
  margin: 5px 0 0;
}

.dc-history-list {
  display: flex;
  flex-direction: column;
}

.dc-history-item {
  border-bottom: 1px solid var(--dc-line);
  padding: 12px 4px;
}

.dc-history-item:last-child {
  border-bottom: 0;
}

.dc-history-item header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.dc-history-item header > div {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 10px;
}

.dc-history-item summary {
  color: var(--dc-muted);
  cursor: pointer;
  font-size: 0.76rem;
  margin-top: 8px;
}

.dc-history-content {
  background: var(--dc-surface-2);
  border: 1px solid var(--dc-line);
  border-radius: 8px;
  font-size: 0.74rem;
  line-height: 1.7;
  margin: 10px 0 0;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

/* ---------- 遮罩与抽屉 -------------------------------------------------- */

.dc-scrim {
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  background: rgba(11, 13, 16, 0.44);
  inset: 0;
  opacity: 0;
  position: fixed;
  transition: opacity 0.24s var(--dc-fast);
  z-index: 85;
}

.dc-scrim.is-visible {
  opacity: 1;
}

.dc-scrim[hidden] {
  display: none;
}

body.dc-lock {
  overflow: hidden;
}

/* ---------- 响应式 ------------------------------------------------------ */

@media (max-width: 1360px) {
  .dc-shell {
    gap: 24px;
    grid-template-columns: 240px minmax(0, 1fr) 214px;
    padding: 24px 26px 72px;
  }
}

@media (max-width: 1080px) {
  .dc-shell {
    gap: 22px;
    grid-template-columns: 240px minmax(0, 1fr) 210px;
    padding: 22px 24px 68px;
  }

  .dc-article {
    padding: 32px 36px 40px;
  }
}

@media (max-width: 1024px) {
  .dc-shell,
  .dc-shell--wide {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .dc-toc {
    -webkit-backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
    backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
    background: var(--dc-surface);
    background: color-mix(in srgb, var(--dc-surface) 88%, transparent);
    border: 0;
    border-radius: 18px 0 0 18px;
    bottom: 0;
    box-shadow: var(--dc-shadow-lg);
    display: block;
    max-height: none;
    padding: 14px;
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(105%);
    transition: transform 0.32s var(--dc-ease);
    width: min(330px, 88vw);
    z-index: 90;
  }

  .dc-toc .dc-toc-head {
    padding: 0 0 10px;
  }

  .dc-toc.is-open {
    transform: none;
  }

  .dc-toc-close,
  .dc-toc-btn {
    display: inline-flex;
  }
}

@media (max-width: 900px) {
  .dc-topbar-inner {
    gap: 8px;
    padding: 0 12px;
  }

  .dc-brand-wordmark,
  .dc-brand-sep,
  .dc-topnav,
  .dc-search,
  .dc-login {
    display: none;
  }

  /* 小屏保留头像入口，只收起昵称与箭头 */
  .dc-user span,
  .dc-user-caret {
    display: none;
  }

  .dc-user {
    padding: 4px;
  }

  .dc-brand-text {
    font-size: 0.82rem;
  }

  .dc-menu-btn,
  .dc-search-toggle {
    display: inline-flex;
  }

  .dc-shell,
  .dc-shell--wide {
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
    padding: 14px 14px 56px;
  }

  .dc-nav {
    -webkit-backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
    backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
    background: var(--dc-surface);
    background: color-mix(in srgb, var(--dc-surface) 88%, transparent);
    border: 0;
    border-radius: 0 18px 18px 0;
    bottom: 0;
    box-shadow: var(--dc-shadow-lg);
    display: block;
    left: 0;
    max-height: none;
    padding: 14px;
    position: fixed;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.32s var(--dc-ease);
    width: min(310px, 88vw);
    z-index: 90;
  }

  .dc-nav .dc-nav-head {
    padding: 0 0 10px;
  }

  .dc-nav.is-open {
    transform: none;
  }

  .dc-nav-close {
    display: inline-flex;
  }

  .dc-article {
    border-radius: 14px;
    min-height: 50vh;
    padding: 22px 18px 28px;
  }

  .dc-article-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .dc-article h1 {
    font-size: 1.5rem;
  }

  .dc-content {
    font-size: 0.93rem;
    line-height: 1.8;
  }

  .dc-content h2 {
    font-size: 1.26rem;
  }

  .dc-content h3 {
    font-size: 1.06rem;
  }

  .dc-crumbs {
    margin-bottom: 10px;
  }

  .dc-pager {
    grid-template-columns: 1fr;
  }

  .dc-pager-next {
    text-align: left;
  }

  .dc-admin {
    padding: 18px 14px 60px;
  }

  .dc-admin-head h1 {
    font-size: 1.28rem;
  }

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

  .dc-form-side {
    position: static;
  }

  .dc-editor-tabs {
    display: inline-flex;
  }

  .dc-editor-panes {
    grid-template-columns: minmax(0, 1fr);
    min-height: 420px;
  }

  .dc-editor-write textarea {
    min-height: 420px;
  }

  .dc-editor-preview {
    border-left: 0;
    display: none;
    max-height: none;
  }

  .dc-editor.is-preview .dc-editor-write {
    display: none;
  }

  .dc-editor.is-preview .dc-editor-preview {
    display: block;
  }

  .dc-search.is-open {
    background: var(--dc-surface);
    border-radius: 12px;
    box-shadow: var(--dc-shadow-lg);
    display: block;
    left: 10px;
    margin: 0;
    max-width: none;
    padding: 8px;
    position: fixed;
    right: 10px;
    top: calc(var(--dc-topbar) + 8px);
    z-index: 96;
  }

  .dc-search.is-open .dc-search-panel {
    left: -1px;
    position: static;
    right: -1px;
    top: auto;
  }
}

@media (max-width: 520px) {
  .dc-brand-logo {
    height: 26px;
  }

  .dc-top-actions {
    gap: 0;
  }

  .dc-icon-btn {
    height: 32px;
    width: 32px;
  }

  .dc-search-hero {
    padding: 20px 18px;
  }

  .dc-search-hero h1 {
    font-size: 1.3rem;
  }

  .dc-search-hero-form {
    flex-wrap: wrap;
    padding: 8px;
  }

  .dc-search-hero-form input {
    flex: 1 1 140px;
  }

  .dc-search-hero-form .dc-btn {
    width: 100%;
  }

  .dc-result {
    padding: 16px 18px;
  }

  .dc-result h2 {
    font-size: 1rem;
  }

  .dc-result-meta {
    font-size: 0.7rem;
  }

  .dc-article-kicker {
    font-size: 0.62rem;
  }
}

/* ---------- 动效 -------------------------------------------------------- */

@keyframes dc-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 降级 -------------------------------------------------------- */

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dc-topbar,
  .dc-article,
  .dc-panel,
  .dc-search-box,
  .dc-search-panel,
  .dc-pager-link,
  .dc-search-hero,
  .dc-result,
  .dc-btn {
    background: var(--dc-surface);
  }

  .dc-content pre {
    background: var(--dc-surface-2);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .dc-topbar,
  .dc-article,
  .dc-panel,
  .dc-search-box,
  .dc-search-panel,
  .dc-pager-link,
  .dc-search-hero,
  .dc-result,
  .dc-btn,
  .dc-content pre {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--dc-surface);
  }

  .dc-content pre {
    background: var(--dc-surface-2);
  }
}

@keyframes dc-theme-reveal {
  from {
    clip-path: circle(0 at var(--dc-theme-x, 50%) var(--dc-theme-y, 0));
  }
  to {
    clip-path: circle(150% at var(--dc-theme-x, 50%) var(--dc-theme-y, 0));
  }
}

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation: none;
  }

  ::view-transition-new(root) {
    animation: dc-theme-reveal 0.62s var(--dc-ease) both;
  }
}

html.dc-theme-anim body.docs-page,
html.dc-theme-anim body.docs-page * {
  transition:
    background-color 0.42s ease,
    color 0.42s ease,
    border-color 0.42s ease,
    box-shadow 0.42s ease !important;
}

@media (prefers-reduced-motion: reduce) {
  body.docs-page *,
  body.docs-page *::before,
  body.docs-page *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
