:root {
  color-scheme: light;
  --bg: #f8f4ef;
  --ink: #1b1b1f;
  --muted: #60606a;
  --accent: #2a7fff;
  --accent-deep: #1c54c7;
  --border: rgba(24, 24, 27, 0.12);
  --panel: rgba(255, 255, 255, 0.85);
  --panel-light: rgba(255, 255, 255, 0.95);
  --dot-1: #ff6b6b;
  --dot-2: #4d96ff;
  --dot-3: #2ec4b6;
  --dot-4: #ffb703;
  --dot-5: #a855f7;
  --dot-6: #22c55e;
  --dot-7: #f97316;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #ffa5ae 0%, #c6f0f2 45%, #b0baf8 100%);
  min-height: 100vh;
  overflow: hidden;
}


.wave-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.wave-box {
  position: absolute;
  inset: -4%;
  margin: auto;
  width: 108%;
  height: 108%;
  background-image: url("./assets/shuibo3.jpeg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  filter: url(#wave);
}

.wave-blur {
  position: absolute;
  height: 100%;
  width: 100%;
  inset: 0;
}

.wave-blur > div {
  position: absolute;
  height: 100%;
  width: 100%;
  inset: 0;
  backdrop-filter: blur(var(--blur-amount));
  mask-image: linear-gradient(180deg, transparent, transparent var(--stop1), black var(--stop2), black);
}

.wave-blur > div:nth-child(1) {
  --blur-amount: 2px;
  --stop1: 0%;
  --stop2: 0%;
}

.wave-blur > div:nth-child(2) {
  --blur-amount: 4px;
  --stop1: 40%;
  --stop2: 80%;
}

.wave-blur > div:nth-child(3) {
  --blur-amount: 16px;
  --stop1: 40%;
  --stop2: 70%;
}

.wave-blur > div:nth-child(4) {
  --blur-amount: 32px;
  --stop1: 70%;
  --stop2: 80%;
}

.layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 0;
  padding: 24px;
  z-index: 1;
  height: auto;
  /* max-width: 1440px; */
  margin: 0 auto;
}

.sidebar {
  background: rgba(255, 255, 255, 0.4);
  border: none;
  padding: 20px;
  height: calc(100vh - 48px);
  position: sticky;
  top: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 20px;
  padding: 4px;
  color: var(--ink);
}

.sidebar-logo-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.count-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px 5px 8px;
  font-size: 12px;
  line-height: 100%;
  background: rgba(255, 255, 255, 1);
  color: #000;
}

.sidebar-close {
  display: none;
  margin-bottom: 16px;
  align-self: flex-end;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  line-height: 32px;
}

.filter {
  position: relative;
}

.filter-trigger {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.filter-arrow {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid rgba(24, 24, 27, 0.45);
  border-bottom: 1.5px solid rgba(24, 24, 27, 0.45);
  transform: rotate(45deg);
  margin-top: -2px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0);
  background: #fff;
  height: 32px;
  padding: 0 32px 0 12px;
  font-size: 13px;
  color: #000;
  outline: none;
  transition: border 0.3s ease;
}

.search input:hover {
  border-color: rgba(0, 0, 0, 0.4);
  transition: border 0.3s ease;
}

.search input:focus {
  border-color: #000;
  box-shadow: none;
  transition: border 0.3s ease;
}

.search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search input[type="search"]::-ms-clear {
  display: none;
}

.search input[type="search"]::-ms-reveal {
  display: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.3s ease;
}

.search-clear:hover {
  color: rgba(0, 0, 0, 1);
  transition: color 0.3s ease;
}

.search-clear svg {
  width: 16px;
  height: 16px;
  display: block;
}

.nav {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 20px 0;
  flex: 1 1 auto;
  min-height: 0;
}

.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group summary {
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  padding: 8px 0;
  user-select: none;
  text-transform: none;
  transition: color 0.3s ease;
}

.nav-group summary:hover {
  color: rgba(0, 0, 0, 1);
  transition: color 0.3s ease;
}


.nav-group-summary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-group-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.6);
  transition: color 0.3s ease;
}

.nav-group summary:hover .nav-group-icon {
  color: rgba(0, 0, 0, 1);
  transition: color 0.3s ease;
}

.nav-group-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.nav-group-icon-minus {
  display: none;
}

.nav-group[open] .nav-group-icon-plus {
  display: none;
}

.nav-group[open] .nav-group-icon-minus {
  display: inline-flex;
}

.nav-group-label {
  flex: 1;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-footer {
  position: sticky;
  bottom: 0;
  margin-top: auto;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.4);
  color: #000;
  text-decoration: none;
  line-height: 32px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: background 0.3s ease;
}

.sidebar-footer-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.sidebar-footer-link:hover {
  background: rgba(255, 255, 255, 0.8);
  transition: background 0.3s ease;
}

.nav-item {
  padding: 12px 16px 16px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.4);
  margin-top: 12px;
  transition: background 0.3s ease;
}

.nav-item.active {
  color: #000;
  border-color: #000;
  background: #fff;
}

.nav-item.active .nav-title {
  color: #000;
}

.nav-item:hover {
  background: #fff;
  transition: background 0.3s ease;
}

.nav-title {
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

.nav-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-top: 12px;
  display: block;
}

.content {
  background: rgba(255, 255, 255, 0.72);
  border: none;
  height: calc(100vh - 48px);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Hide scrollbars but keep scroll */
.nav,
.content-scroll,
.filter-menu,
.doc-column {
  scrollbar-width: none;
}

.nav::-webkit-scrollbar,
.content-scroll::-webkit-scrollbar,
.filter-menu::-webkit-scrollbar,
.doc-column::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.content-actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0);
  z-index: 2;
  flex-shrink: 0;
  justify-content: space-between;
}

.content-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.content-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #fff;
  padding: 2px;
}

.content-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

.menu-toggle {
  display: none;
}

.tab-button {
  border: none;
  color: #000;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0);
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-button.active {
  background: #000;
  color: #fff;
}

.tab-button:hover {
  background: rgba(0, 0, 0, 0.08);
}

.tab-button.active:hover {
  background: rgba(0, 0, 0, 0.85);
}

.content-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.copyright-note {
  font-size: 12px;
  line-height: 20px;
  color: rgba(0, 0, 0, 0.4);
  font-style: italic;
  margin-right: 8px;
  padding: 0 12px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.04);
}

.icon-button {
  width: 32px;
  height: 32px;
  border: none;
  background: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  color: #fff;
  transition: background 0.15s ease, color 0.15s ease;
}

.menu-toggle,
.sidebar-close {
  display: none;
}

.icon-button:hover {
  background: rgba(0, 0, 0, 0.85);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.icon-button-outline {
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: #000;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-button-outline:hover {
  background: rgba(0, 0, 0, 0.14);
}

.icon-button-outline svg {
  fill: #000;
}

.icon-button:disabled,
.icon-button-outline:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.icon-button.is-copied svg {
  opacity: 0;
}

.icon-button.is-copied::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  display: block;
  background: currentColor;
  pointer-events: none;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9.00016 16.2L4.80016 12L3.40016 13.4L9.00016 19L21.0002 7.00001L19.6002 5.60001Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9.00016 16.2L4.80016 12L3.40016 13.4L9.00016 19L21.0002 7.00001L19.6002 5.60001Z'/%3E%3C/svg%3E");
}

.content-scroll {
  flex: 1;
  overflow: hidden;
  margin: 0 32px;
  display: flex;
  flex-direction: column;
}

.doc-wrap {
  display: flex;
  flex-direction: row;
  gap: 8px;
  min-height: 100%;
}

.doc-column {
  flex-basis: 50%;
  overflow-y: auto;
  padding: 16px 40px;
  background: rgba(255, 255, 255, 1);
}

.preview-column {
  flex-basis: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.action {
  border: none;
  background: #000;
  color: #fff;
  height: 32px;
  padding: 0 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.action:hover {
  background: rgba(0, 0, 0, 0.85);
}

.action.action-outline {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  border: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.action.action-outline:hover {
  background: rgba(0, 0, 0, 0.14);
}

.content-footer {
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#prevDoc {
  padding: 0 16px 0 10px;
}

#nextDoc {
  padding: 0 10px 0 16px;
}

.markdown-body {
  line-height: 1.7;
  font-size: 16px;
  color: var(--ink);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin-top: 28px;
}

.markdown-body h2 {
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  color: var(--muted);
  margin: 16px 0;
}

.markdown-body code {
  background: rgba(255, 123, 58, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  white-space: pre-wrap;
  word-break: break-word;
}

.markdown-body pre {
  background: #141218;
  color: #f5f5f7;
  padding: 18px;
  border-radius: 12px;
  overflow: auto;
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: none;
  /* border: 1px solid rgba(0, 0, 0, .2); */
}

.inline-preview-frame {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  border: none;
  display: none;
}

.markdown-body {
  flex: 1 1 0;
}

.preview-empty {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

.markdown-body + #docEmpty {
  background: rgba(0, 0, 0, 0);
}

.preview-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  color: #000;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  pointer-events: none;
  z-index: 3;
}

.preview-only {
  flex: 1;
  display: none;
  position: relative;
}

@media (max-width: 1024px) {

  .nav-item-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 8px
  }

  .nav-item {
    margin-top: 0;
  }

  .nav-group-summary {
    grid-column: 1 / -1;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    transform: translateY(-110%);
    transition: transform 0.2s ease;
    z-index: 20;
    padding: 28px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(8px);
  }

  .content {
    height: calc(100vh - 48px);
  }

  .content-actions {
    align-items: flex-start;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .doc-wrap {
    flex-direction: column;
  }

  .preview-column {
    order: -1;
    overflow-y: auto;
    flex: 0 0 auto;
  }

  .inline-preview-frame {
    height: 600px;
    min-height: 600px;
  }

  .preview-empty {
    height: 600px;
    min-height: 600px;
  }

  .doc-column {
    overflow: visible;
  }

  .content-scroll {
    overflow-y: auto;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 15;
  }

  body.sidebar-open .sidebar {
    transform: translateY(0);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }
}

.icon-button.is-copied svg * {
  d: path("M9.00016 16.2L4.80016 12L3.40016 13.4L9.00016 19L21.0002 7.00001L19.6002 5.60001Z");
}
