/* 只读对外展示页：白板铺满 + 右侧悬浮笔记抽屉
 * 笔记区固定「长风连暮云」(twilight)，不跟随站点主题切换。
 */
.notes-display {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f7;
  /* 锁定 twilight 文本/表面变量，避免 markdown 预览随 data-theme 变色 */
  --ink-bg: #ffffff;
  --ink-bg-alt: #f5f5f7;
  --ink-surface: rgba(255, 255, 255, 0.94);
  --ink-surface-solid: #ffffff;
  --ink-surface-2: #f5f5f7;
  --ink-border: #d2d2d7;
  --ink-text: #000000;
  --ink-muted: #6e6e73;
  --ink-accent: #000000;
  --ink-accent-soft: rgba(0, 0, 0, 0.06);
  color: #000000;
}

.display-notes-panel,
.display-doc-body.ws-doc-preview {
  --ink-surface-solid: #ffffff;
  --ink-text: #000000;
  --ink-muted: #6e6e73;
  --ink-border: #d2d2d7;
  --ink-accent: #000000;
  color: #000000;
  background: #ffffff;
}

.display-app {
  --display-inset: 16px;
  --display-notes-width: min(720px, calc(100vw - 48px));
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.display-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  z-index: 30;
}

.display-brand {
  font-weight: 700;
  color: #111827;
  text-decoration: none;
  white-space: nowrap;
}

.display-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-notes-toggle {
  flex-shrink: 0;
}

.display-notes-toggle.is-active {
  background: rgba(105, 101, 219, 0.12);
  color: #6965db;
}

.display-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  flex-shrink: 0;
}

.display-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.display-stage .wb-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.display-zoom {
  position: absolute;
  right: var(--display-inset);
  bottom: var(--display-inset);
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.display-app.notes-open .display-zoom {
  right: calc(var(--display-notes-width) + var(--display-inset) + 8px);
}

.display-hint {
  position: absolute;
  left: var(--display-inset);
  bottom: var(--display-inset);
  margin: 0;
  font-size: 0.78rem;
  color: #6b7280;
  pointer-events: none;
  z-index: 12;
}

.display-notes-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.display-notes-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.display-notes-panel {
  position: absolute;
  top: var(--display-inset);
  right: var(--display-inset);
  bottom: var(--display-inset);
  width: var(--display-notes-width);
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14);
  transform: translateX(calc(100% + var(--display-inset) + 8px));
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  will-change: transform;
}

.display-notes-panel.open {
  transform: translateX(0);
}

.display-notes-panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f8f9fa;
  flex-shrink: 0;
}

.display-notes-panel-title {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-notes-panel-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(120px, 156px) minmax(0, 1fr);
}

.display-notes-list-wrap {
  border-right: 1px solid #e5e7eb;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.display-notes-list {
  list-style: none;
  margin: 0;
  padding: 0.45rem;
  overflow: auto;
  flex: 1;
}

.display-notes-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 0.5rem 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  color: #111827;
  cursor: pointer;
}

.display-notes-item:hover {
  background: #eef2ff;
}

.display-notes-item.is-active {
  background: #e0e7ff;
  font-weight: 600;
}

.display-notes-item .name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.display-notes-empty {
  margin: 0.75rem;
  color: #9ca3af;
  font-size: 0.85rem;
}

.display-notes-reader {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.display-doc-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.15rem 1.5rem;
}

.display-error {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 1rem 1.25rem;
  max-width: 24rem;
  text-align: center;
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  z-index: 60;
}

body.notes-display .notes-theme-panel-wrap,
body.notes-display .notes-bg-decoration {
  display: none !important;
}

@media (max-width: 720px) {
  .display-app {
    --display-inset: 0;
    --display-notes-width: 100%;
  }

  .display-notes-panel {
    top: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    border: none;
  }

  .display-app.notes-open .display-zoom {
    right: var(--display-inset);
    opacity: 0;
    pointer-events: none;
  }

  .display-notes-panel-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .display-notes-list-wrap {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    max-height: 30vh;
  }

  .display-notes-list {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.5rem;
  }

  .display-notes-list li {
    flex: 0 0 auto;
  }

  .display-notes-item {
    white-space: nowrap;
    max-width: 10rem;
  }
}
