.icp-footer {
  pointer-events: auto;
  text-align: center;
  transform-origin: center bottom;
  z-index: 1001 !important;
}

.main-content {
  z-index: 2;
}

.nav-sidebar-favicon {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.nav-icon-slot {
  opacity: 1;
}

.nav-link-text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.nav-link-remark {
  max-width: 138px;
  overflow: hidden;
  color: #9f927d;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut-icon,
.nav-sidebar-favicon,
.nav-manager-row img {
  background: #f7f3df;
}

.sidebar-panel.level-2,
.sidebar-panel.level-3 {
  height: calc(100vh - max(0px, var(--panel-y, 0px)));
  max-height: calc(100vh - max(0px, var(--panel-y, 0px)));
}

.sidebar-panel.level-2.open,
.sidebar-panel.level-3.open {
  width: max-content;
  max-width: min(640px, calc(100vw - 150px));
}

.sidebar-panel.nav-panel-connected {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.sidebar-panel.level-2 .panel-list,
.sidebar-panel.level-3 .panel-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(130px, max-content);
  grid-template-rows: repeat(auto-fill, 31px);
  align-content: start;
  overflow-x: visible;
  overflow-y: hidden;
  max-height: calc(100vh - max(0px, var(--panel-y, 0px)) - 44px);
}

.sidebar-panel.level-2 .link-wrapper,
.sidebar-panel.level-3 .link-wrapper,
.sidebar-panel.level-2 .panel-item,
.sidebar-panel.level-3 .panel-item {
  min-width: 0;
}

.sidebar-panel.level-2 .item-name,
.sidebar-panel.level-3 .item-name {
  max-width: 138px;
}

@media (max-height: 720px) {
  .sidebar-panel.level-2 .panel-list,
  .sidebar-panel.level-3 .panel-list {
    grid-template-rows: repeat(auto-fill, 30px);
  }
}

.nav-bookmark-manager {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-manager-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 8px;
  border-bottom: 1.5px solid rgba(159, 146, 125, 0.18);
}

.nav-manager-toolbar button,
.nav-edit-modal button {
  border: 1.5px solid rgba(159, 146, 125, 0.25);
  border-radius: 10px;
  background: #f7f3df;
  color: #725d42;
  cursor: pointer;
  font: inherit;
  padding: 7px 12px;
}

.nav-manager-toolbar span {
  color: #9f927d;
  font-size: 12px;
}

.nav-manager-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.nav-manager-row {
  display: grid;
  grid-template-columns: 22px 20px 26px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  padding: 7px 8px 7px calc(8px + var(--depth, 0) * 22px);
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: rgba(247, 243, 223, 0.48);
  cursor: default;
  user-select: none;
  position: relative;
}

.nav-folder-toggle {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #9f927d;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0;
}

.nav-folder-toggle:disabled {
  cursor: default;
  opacity: 0;
}

.nav-folder-toggle:not(:disabled):hover {
  background: rgba(25, 200, 185, 0.12);
  color: #3d7069;
}

.nav-manager-row:hover {
  border-color: rgba(25, 200, 185, 0.35);
  background: rgba(247, 243, 223, 0.78);
}

.nav-manager-row.dragging {
  opacity: 0.3;
}

.nav-manager-row.drop-into {
  border-color: #19c8b9;
  background: rgba(25, 200, 185, 0.14);
}

.nav-manager-row.drop-into::after {
  content: "放入文件夹";
  position: absolute;
  right: 64px;
  top: 50%;
  transform: translateY(-50%);
  color: #3d7069;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.nav-manager-row.drop-before::before,
.nav-manager-row.drop-after::before {
  content: "";
  position: absolute;
  left: calc(8px + var(--depth, 0) * 22px);
  right: 8px;
  height: 2px;
  border-radius: 2px;
  background: #19c8b9;
  box-shadow: 0 0 0 3px rgba(25, 200, 185, 0.12);
  pointer-events: none;
}

.nav-manager-row.drop-before::before {
  top: -4px;
}

.nav-manager-row.drop-after::before {
  bottom: -4px;
}

.drag-handle {
  color: #c4b89e;
  cursor: grab;
  font-weight: 700;
  touch-action: none;
}

.drag-handle:active,
.nav-dragging-active,
.nav-dragging-active * {
  cursor: grabbing !important;
}

.nav-drag-ghost {
  position: fixed;
  z-index: 10002;
  box-shadow: 0 12px 28px rgba(61, 52, 40, 0.2);
  opacity: 0.95;
  pointer-events: none;
  transform: rotate(-0.6deg);
}

.nav-row-icon,
.nav-row-icon img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.nav-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.nav-row-main b,
.nav-row-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-row-main b {
  color: #725d42;
  font-size: 13px;
}

.nav-row-main small {
  color: #9f927d;
  font-size: 11px;
}

.nav-edit {
  border: none;
  border-radius: 9px;
  background: rgba(25, 200, 185, 0.12);
  color: #3d7069;
  cursor: pointer;
  padding: 5px 8px;
}

.nav-edit,
.nav-manager-toolbar button,
.nav-edit-modal button {
  cursor: pointer !important;
}

.nav-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 52, 40, 0.28);
  cursor: default;
}

.nav-edit-modal {
  width: min(460px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 2px solid rgba(159, 146, 125, 0.22);
  border-radius: 18px;
  background: #fff8e8;
  box-shadow: 0 16px 44px rgba(61, 52, 40, 0.22);
  cursor: default;
}

.nav-edit-modal h3 {
  margin: 0;
  color: #794f27;
  font-size: 18px;
}

.nav-edit-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #725d42;
  font-size: 13px;
  font-weight: 700;
}

.nav-edit-modal input,
.nav-edit-modal textarea,
.nav-edit-modal select {
  width: 100%;
  border: 1.5px solid rgba(159, 146, 125, 0.24);
  border-radius: 10px;
  background: #f7f3df;
  color: #725d42;
  font: inherit;
  padding: 9px 10px;
  outline: none;
}

.nav-edit-modal textarea {
  min-height: 72px;
  resize: vertical;
}

.nav-modal-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 8px;
  align-items: center;
}

.nav-edit-modal .primary {
  background: #19c8b9;
  color: #fff;
}

.nav-edit-modal .danger {
  background: #fff1ef;
  color: #c94444;
}

.nav-manager-loading {
  padding: 24px;
  color: #9f927d;
  text-align: center;
}

.nav-confirm-popover {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 10020;
  min-width: 320px;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 12px 16px;
  border: 2px solid rgba(159, 146, 125, 0.22);
  border-radius: 14px;
  background: #fff8e8;
  box-shadow: 0 12px 32px rgba(61, 52, 40, 0.22);
  color: #794f27;
}

.nav-confirm-title {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-confirm-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.nav-confirm-actions button {
  border: 1.5px solid rgba(159, 146, 125, 0.22);
  border-radius: 10px;
  background: #f7f3df;
  color: #725d42;
  cursor: pointer;
  font: inherit;
  padding: 7px 12px;
}

.nav-confirm-actions .danger {
  border-color: rgba(201, 68, 68, 0.22);
  background: #fff1ef;
  color: #c94444;
}

.nav-password-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1.5px solid rgba(159, 146, 125, 0.15);
}

.nav-password-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nav-password-grid input {
  min-width: 0;
  height: 36px;
  border: 2px solid rgba(196, 184, 158, 0.42);
  border-radius: 18px;
  background: #f8f8f0;
  color: #725d42;
  font: inherit;
  outline: none;
  padding: 0 12px;
}

.nav-password-grid input:focus {
  border-color: #ffcc00;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.14);
}

.nav-password-grid button {
  height: 36px;
  border: none;
  border-radius: 18px;
  background: #19c8b9;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.nav-password-grid button:hover {
  background: #11a89b;
}

.nav-password-message {
  min-height: 18px;
  margin-top: 6px;
  color: #9f927d;
  font-size: 12px;
}

.nav-password-message.success {
  color: #3d7069;
}

.nav-password-message.error {
  color: #c94444;
}

@media (max-width: 620px) {
  .nav-password-grid {
    grid-template-columns: 1fr;
  }
}
