/**
 * 森语地图侧边栏样式
 * 左侧：TabHost（底）+ DetailHost（顶）
 */

:root {
  /* 全局搜索栏高度：padding 12*2 + input 40 */
  --woodsper-search-bar-height: 64px;
}

.woodsper-sidebar {
  position: absolute;
  left: 0;
  /* 从搜索栏底部开始，避免被搜索栏遮挡 */
  top: var(--woodsper-search-bar-height);
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(0.95);
  -webkit-backdrop-filter: blur(20px) saturate(0.95);
  border-right: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  will-change: transform;
  /* 必须 visible：折叠按钮在 right:-40px，hidden 会裁掉 */
  overflow: visible;
  /* 为底部常驻 Tab（侧栏兄弟节点）预留高度 */
  padding-bottom: 58px;
  box-sizing: border-box;
}

.woodsper-sidebar.collapsed {
  transform: translateX(-100%);
}

/* 折叠按钮（挂在侧栏右缘外侧，朝向地图） */
.sidebar-toggle {
  position: absolute;
  /* 作为 .woodsper-sidebar 的兄弟元素，挂在 360px 宽侧栏的右缘 */
  left: 360px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  border: none;
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 0 12px rgba(15, 23, 42, 0.1);
  transition: all 0.2s ease;
  z-index: 1205;
}

/* 收起后按钮贴地图左缘，用于重新展开 */
.woodsper-sidebar.collapsed ~ .sidebar-toggle {
  left: 0;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 1);
  color: #2563eb;
}

.woodsper-sidebar.collapsed ~ .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* 底部抽屉把手栏：仅小屏显示，桌面隐藏 */
.sidebar-sheet-bar {
  display: none;
}

.sidebar-zstack {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
}

/* ========== TabHost ========== */
.sidebar-tab-host {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-search {
  flex-shrink: 0;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.sidebar-search-input {
  width: 100%;
  box-sizing: border-box;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.92);
  color: #0f172a;
  font-size: 14px;
  outline: none;
}

.sidebar-search-input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.sidebar-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

/* Tab 栏在底部（桌面：贴在侧栏底；小屏：常驻视口底） */
.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0 8px 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(0.95);
  -webkit-backdrop-filter: blur(16px) saturate(0.95);
  flex-shrink: 0;
  /* 桌面：作为侧栏兄弟节点，绝对定位叠在侧栏底部 */
  position: absolute;
  left: 0;
  bottom: 0;
  width: 360px;
  max-width: 90vw;
  z-index: 1202;
  box-sizing: border-box;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

/* 桌面侧栏收起时，Tab 一并滑出 */
.woodsper-sidebar.collapsed ~ .sidebar-tabs {
  transform: translateX(-100%);
  pointer-events: none;
}

.sidebar-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 8px;
  border: none;
  border-radius: 0 0 8px 8px;
  background: transparent;
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-tab:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.sidebar-tab.active {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  font-weight: 600;
}

.sidebar-tab.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  background: #2563eb;
  border-radius: 0 0 2px 2px;
}

.sidebar-tab-icon {
  font-size: 18px;
}

.sidebar-tab-text {
  white-space: nowrap;
}

/* 内容区 */
.sidebar-content {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.sidebar-list {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  display: none;
}

.sidebar-list.active {
  display: block;
}

/* 森灵卡片 */
.spirit-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.spirit-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
}

.spirit-item-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.spirit-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spirit-item-info {
  flex: 1;
  min-width: 0;
}

.spirit-item-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 4px;
}

.spirit-item-location {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.spirit-item-intro {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 作品卡片 - iOS风格布局 */
.work-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  margin-bottom: 12px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.work-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* 作品头部 - 作者信息 */
.work-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.work-item-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.work-item-author-avatar.is-clickable,
.work-item-author-name.is-clickable {
  cursor: pointer;
}

.work-item-author-name.is-clickable:hover {
  color: #7c3aed;
}

.work-item-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-item-author-initial {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.work-item-author-info {
  flex: 1;
  min-width: 0;
}

.work-item-author-name {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}

.work-item-time {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 2px;
}

.work-item-location {
  font-size: 11px;
  color: #64748b;
}

/* 作品图片 */
.work-item-image {
  width: 100%;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.work-item-image img {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 280px;
}

/* 作品内容 */
.work-item-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.work-item-text {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.6;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 计划卡片 */
.plan-item {
  padding: 12px;
  margin-bottom: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 51, 234, 0.15);
}

.plan-item-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-item-type {
  font-size: 11px;
  font-weight: 600;
  color: #7e22ce;
  padding: 2px 6px;
  background: rgba(147, 51, 234, 0.12);
  border-radius: 4px;
}

.plan-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.plan-item-location {
  font-size: 11px;
  color: #64748b;
}

.plan-item-time {
  font-size: 12px;
  color: #64748b;
}

/* 计划状态badge */
.plan-status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.plan-status-badge--upcoming {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.plan-status-badge--current {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.plan-status-badge--expired {
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
}

.plan-status-badge--completed {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
}

/* 图鉴卡片 */
.atlas-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
}

.atlas-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.atlas-item-cover {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.atlas-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.atlas-item-cover-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  background: #dbeafe;
}

.atlas-item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.atlas-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.atlas-item-category {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  padding: 2px 6px;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 4px;
  align-self: flex-start;
  flex-shrink: 0;
}

.atlas-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.atlas-item-tags {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.atlas-item-description {
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.atlas-item-location {
  font-size: 11px;
  color: #64748b;
}

/* 空状态 */
.sidebar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

/* 空状态 - 开发中提示 */
.sidebar-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  min-height: 300px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.8;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-title {
  font-size: 17px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.empty-state-description {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  max-width: 240px;
}

/* 加载状态 */
.sidebar-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 13px;
}

.sidebar-loading::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 2px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 列表底部：加载中 / 上拉加载更多 / 没有更多了 */
.sidebar-list-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px 20px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  min-height: 52px;
}

.sidebar-list-footer--more {
  color: #94a3b8;
}

.sidebar-list-footer--loading {
  color: #64748b;
}

.sidebar-loading-view {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* 兼容旧类名 */
.sidebar-loading-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

/* 错误状态 */
.sidebar-error {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: #ef4444;
  font-size: 13px;
}

/* 动画 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 响应式 */
@media (max-width: 768px) {
  :root {
    /* 常驻底栏高度（不含 safe-area；safe-area 另加在 padding / margin 上） */
    --sidebar-mobile-tabbar-height: 58px;
  }

  /* 小屏：侧栏改为底部抽屉；底边停在常驻 Tab 之上；顶边在搜索栏下方 */
  .woodsper-sidebar {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    top: calc(5% + var(--woodsper-search-bar-height));
    bottom: calc(var(--sidebar-mobile-tabbar-height) + env(safe-area-inset-bottom, 0px));
    height: auto;
    padding-bottom: 0;
    border-right: 0;
    border-radius: 18px 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    /* 默认收起：整体滑出屏幕底部，地图完全可见；Tab 栏独立常驻 */
    transform: translateY(calc(100% + 24px));
  }

  .woodsper-sidebar:not(.collapsed) {
    transform: translateY(0);
  }

  .woodsper-sidebar.collapsed {
    transform: translateY(calc(100% + 24px));
    pointer-events: none;
  }

  /* 小屏用常驻 Tab 展开，隐藏原悬浮打开按钮 */
  .sidebar-toggle,
  .woodsper-sidebar.collapsed ~ .sidebar-toggle,
  .woodsper-sidebar ~ .sidebar-toggle,
  .woodsper-sidebar:not(.collapsed) ~ .sidebar-toggle {
    display: none;
  }

  /* 抽屉顶部把手 + 收起按钮：预留按钮高度，避免压住搜索栏 */
  .sidebar-sheet-bar {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    min-height: 30px;
    padding: 6px 48px 0;
    box-sizing: border-box;
  }

  .sidebar-sheet-handle {
    width: 36px;
    height: 5px;
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.16);
  }

  .sidebar-sheet-close {
    position: absolute;
    /* 距顶 6px；bar 较矮，按钮底部比 bar 略低，与搜索栏只留 2px */
    right: 6px;
    top: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.18);
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-sheet-close:active {
    background: rgba(148, 163, 184, 0.3);
  }

  /* 常驻底栏：收起时也可点 Tab 展开抽屉 */
  .sidebar-tabs,
  .woodsper-sidebar.collapsed ~ .sidebar-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    z-index: 1210;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px) saturate(0.95);
    -webkit-backdrop-filter: blur(16px) saturate(0.95);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12);
    transform: none;
    pointer-events: auto;
  }

  .sidebar-tab {
    padding: 6px 4px;
    font-size: 10px;
    border-radius: 10px;
  }

  .sidebar-tab.active::after {
    display: none;
  }

  .sidebar-tab-icon {
    font-size: 16px;
  }

  .spirit-item {
    padding: 10px;
  }

  .spirit-item-avatar {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

/* 滚动条美化 */
.sidebar-list::-webkit-scrollbar {
  width: 6px;
}

.sidebar-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.sidebar-list::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* ==================== DetailHost：上层唯一详情栈 ==================== */
.sidebar-detail-host {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px) saturate(0.95);
  -webkit-backdrop-filter: blur(20px) saturate(0.95);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  pointer-events: none;
  visibility: hidden;
}

.sidebar-detail-host.is-open {
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
}

.sidebar-detail-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar-detail-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  transform: translateX(0);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  z-index: 1;
}

/* 下层页保持静止：A→B / B→A 只动画顶层 B，避免 A 左右让位再归位 */
.sidebar-detail-page.is-pushed-back {
  transform: translateX(0);
}

.sidebar-detail-page.is-enter {
  transform: translateX(100%);
}

.sidebar-detail-page.is-leave {
  transform: translateX(100%);
  z-index: 3;
}

.sidebar-detail-page.is-top,
.sidebar-detail-page.is-active {
  z-index: 2;
}

.sidebar-page-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.92);
  min-height: 48px;
  box-sizing: border-box;
}

.sidebar-page-back,
.sidebar-page-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #007aff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-page-close {
  color: #334155;
}

.sidebar-page-back:hover,
.sidebar-page-close:hover {
  background: rgba(148, 163, 184, 0.16);
}

.sidebar-page-back[hidden] {
  visibility: hidden !important;
  pointer-events: none;
}

.sidebar-page-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}

.sidebar-page-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.sidebar-detail-page[data-page-type="html"] .sidebar-page-body,
.sidebar-detail-page[data-page-type="work"] .sidebar-page-body,
.sidebar-detail-page[data-page-type="atlas"] .sidebar-page-body,
.sidebar-detail-page[data-page-type="plan"] .sidebar-page-body {
  padding: 16px 14px;
}

.sidebar-page-body .profile-panel.sidebar-profile-host {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
}

/*
 * 嵌入 DetailHost 时：个人主页内的作品/图鉴详情栏藏掉，
 * 统一用 Host 顶栏（不 display:none Host 栏，避免进出跳动）
 */
.sidebar-detail-host .profile-panel.sidebar-profile-host.is-work-detail .profile-panel-detail-nav,
.sidebar-detail-host .profile-panel.sidebar-profile-host.is-work-detail-closing .profile-panel-detail-nav {
  display: none !important;
}

.sidebar-detail-host.is-inner-detail-open .profile-panel.sidebar-profile-host,
.sidebar-detail-host.is-inner-detail-open .profile-panel-main,
.sidebar-detail-host.is-inner-detail-open .profile-panel-stack,
.sidebar-detail-host.is-inner-detail-open .profile-panel-stack-track {
  overflow: visible;
}

.sidebar-detail-host.is-inner-detail-open .profile-panel.sidebar-profile-host .profile-panel-pane--detail {
  z-index: 30;
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-detail-host,
  .sidebar-detail-page {
    transition: none !important;
  }
}

/* 兼容旧类名（若仍有残留引用） */
.sidebar-detail {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.94);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0, 1);
}

.sidebar-detail.active {
  transform: translateX(0);
}

.sidebar-nav-stack {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-nav-pane--base {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-nav-pane--push {
  display: none;
}

.sidebar-profile-mount {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.sidebar-detail-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 48px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
  background: transparent;
  position: relative;
  flex-shrink: 0;
}

.sidebar-detail-back {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #007aff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.sidebar-detail-back:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sidebar-detail-back:active {
  background: rgba(0, 0, 0, 0.08);
}

.sidebar-detail-title {
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  text-align: center;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-detail-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px;
}

.sidebar-detail-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-detail-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-detail-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.sidebar-detail-content::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* 森灵详情 */
.detail-spirit-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 20px;
}

.detail-spirit-avatar {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(147, 51, 234, 0.25);
}

.detail-spirit-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-spirit-name {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.detail-spirit-location {
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.detail-spirit-section {
  margin-bottom: 20px;
}

.detail-spirit-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detail-spirit-intro {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre-wrap;
}

.detail-spirit-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.detail-spirit-info-item {
  padding: 10px;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 8px;
}

.detail-spirit-info-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.detail-spirit-info-value {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

/* 作品详情 */
.detail-work-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 16px;
}

.detail-work-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-work-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-work-author-info {
  flex: 1;
  min-width: 0;
}

.detail-work-author-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}

.detail-work-location {
  font-size: 12px;
  color: #64748b;
}

.detail-work-body {
  margin-bottom: 12px;
}

.detail-work-content {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.detail-work-time {
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
}

.detail-work-cta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.detail-work-comment-cta {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.detail-work-comment-cta:hover {
  background: #1e293b;
}

/* 计划详情 */
.detail-plan-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 16px;
}

.detail-plan-type {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  margin-bottom: 8px;
}

.detail-plan-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 8px;
}

.detail-plan-time {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 4px;
}

.detail-plan-location {
  font-size: 14px;
  color: #64748b;
}

.detail-plan-description {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 图鉴详情 */
.detail-atlas-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 16px;
}

.detail-atlas-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 8px;
}

.detail-atlas-category {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
}

.detail-atlas-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.atlas-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(148, 163, 184, 0.14);
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
}

.detail-atlas-location {
  font-size: 14px;
  color: #64748b;
}

.detail-atlas-description {
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-top: 12px;
}

/* ==================== 图鉴基本信息（basicInfo，对齐 iOS 样式） ==================== */

.detail-atlas-basicinfo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.detail-atlas-place {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.detail-atlas-facilities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}

.detail-atlas-facility {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  font-size: 12px;
  border-radius: 6px;
}

.detail-atlas-facility-check {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.detail-atlas-field {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
}

.detail-atlas-field-icon {
  width: 16px;
  flex: none;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.detail-atlas-field-link {
  color: #2563eb;
  text-decoration: none;
}

.detail-atlas-field-link:hover {
  text-decoration: underline;
}

/* ==================== 作品图集（左右滑动） ==================== */

.woodsper-work-gallery {
  position: relative;
  margin-bottom: 12px;
}

.woodsper-work-gallery-viewport {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #e8edf3;
}

.woodsper-work-gallery-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  outline: none;
  aspect-ratio: 1 / 1;
  max-height: min(420px, 70vh);
}

.woodsper-work-gallery-track::-webkit-scrollbar {
  display: none;
}

.woodsper-work-gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8edf3;
}

.woodsper-work-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.woodsper-work-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: rgba(15, 23, 42, 0.28);
  color: rgba(255, 255, 255, 0.82);
  font-size: 22px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.woodsper-work-gallery-nav span {
  display: block;
  margin-top: -1px;
  opacity: 0.9;
}

.woodsper-work-gallery-nav--prev {
  left: 8px;
}

.woodsper-work-gallery-nav--next {
  right: 8px;
}

@media (hover: hover) {
  .woodsper-work-gallery-viewport:hover .woodsper-work-gallery-nav:not([hidden]) {
    display: inline-flex;
  }
}

.woodsper-work-gallery-nav:hover {
  background: rgba(15, 23, 42, 0.42);
  color: rgba(255, 255, 255, 0.95);
}

.woodsper-work-gallery-nav[hidden] {
  display: none !important;
}

.woodsper-work-gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.woodsper-work-gallery-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.woodsper-work-gallery-dot.is-active {
  background: #3b82f6;
  transform: scale(1.2);
}

.woodsper-work-gallery--single .woodsper-work-gallery-dots,
.woodsper-work-gallery--single .woodsper-work-gallery-nav {
  display: none !important;
}

/* ==================== 作品作者条 ==================== */

.woodsper-work-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 28px;
}

.woodsper-work-author.is-clickable {
  cursor: pointer;
  border-radius: 8px;
  margin-left: -4px;
  margin-right: -4px;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
}

.woodsper-work-author.is-clickable:hover .woodsper-work-author-name {
  color: #1d4ed8;
}

.woodsper-work-author-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.woodsper-work-author-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}

/* ==================== 详情元信息（日期 / 定位） ==================== */

.woodsper-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 12px 0 4px;
  padding-top: 2px;
}

.woodsper-detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.35;
  max-width: 100%;
}

.woodsper-detail-meta-item > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.woodsper-detail-meta-icon {
  font-size: 11px;
  opacity: 0.72;
  flex-shrink: 0;
}

.woodsper-work-detail-content {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}

/* ==================== 评论列表（作品 / 图鉴共用） ==================== */

.woodsper-work-comments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.woodsper-work-comments-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}

.woodsper-work-comments-body {
  min-height: 24px;
  font-size: 12px;
  color: #94a3b8;
}

.woodsper-comment-empty {
  font-size: 12px;
  color: #94a3b8;
  padding: 8px 0;
}

.woodsper-comment-list {
  display: flex;
  flex-direction: column;
}

.woodsper-comment-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.woodsper-comment-item:last-child {
  border-bottom: 0;
}

.woodsper-comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(145deg, #cbd5e1 0%, #94a3b8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.woodsper-comment-avatar.is-clickable {
  cursor: pointer;
}

.woodsper-comment-avatar.is-clickable:hover {
  opacity: 0.88;
}

.woodsper-comment-avatar.is-clickable:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.woodsper-comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.woodsper-comment-avatar-fallback {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.woodsper-comment-main {
  flex: 1;
  min-width: 0;
}

.woodsper-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.woodsper-comment-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.woodsper-comment-name.is-clickable {
  cursor: pointer;
}

.woodsper-comment-name.is-clickable:hover {
  color: #1d4ed8;
}

.woodsper-comment-name.is-clickable:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
  border-radius: 2px;
}

.woodsper-comment-time {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.3;
}

.woodsper-comment-content {
  font-size: 13px;
  line-height: 1.55;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

.woodsper-comment-reply {
  display: inline-block;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.woodsper-comment-reply:hover {
  color: #64748b;
}

.woodsper-comment-reply:active {
  color: #475569;
}

/* ==================== 全局搜索层 ==================== */
.woodsper-search-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  max-width: 90vw;
  z-index: 1300;
  pointer-events: none;
  /* 仅占搜索栏高度；结果面板 absolute 不撑开 */
  height: auto;
  display: block;
  visibility: visible;
  opacity: 1;
  box-sizing: border-box;
}

/* 侧边栏折叠时搜索层保持可见（桌面） */
.woodsper-sidebar.collapsed ~ .woodsper-search-layer {
  transform: none;
}

/* 搜索栏容器 */
.global-search-bar {
  padding: 12px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

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

.global-search-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #0f172a;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: all 0.2s ease;
  outline: none;
}

.global-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.global-search-input::placeholder {
  color: #94a3b8;
}

.global-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.global-search-btn:hover {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.global-search-btn svg {
  width: 18px;
  height: 18px;
}

/* 搜索结果面板 */
.global-search-results {
  position: absolute;
  top: var(--woodsper-search-bar-height);
  left: 0;
  right: 0;
  width: 360px;
  height: calc(100vh - var(--woodsper-search-bar-height));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(0.95);
  -webkit-backdrop-filter: blur(20px) saturate(0.95);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
  visibility: hidden;
}

.global-search-results.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* 搜索结果分类 tab（对齐底部：发现 / 动态 / 森灵 / 图鉴） */
.search-results-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.96);
}

.search-results-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, background 0.15s ease;
}

.search-results-tab:hover {
  color: #334155;
  background: rgba(37, 99, 235, 0.06);
}

.search-results-tab.active {
  color: #2563eb;
  font-weight: 600;
}

.search-results-tab.active::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #2563eb;
}

/* 搜索结果内容区 */
.search-results-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  padding-bottom: 56px;
  background: rgba(248, 250, 252, 0.95);
}

.search-results-content::-webkit-scrollbar {
  width: 6px;
}

.search-results-content::-webkit-scrollbar-track {
  background: transparent;
}

.search-results-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.search-results-content::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* 搜索结果列表 */
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 搜索状态 */
.search-loading,
.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

.search-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

.search-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* 搜索结果底部收起按钮 */
.search-collapse-btn {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  height: 48px;
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-collapse-btn:hover {
  background: rgba(249, 250, 251, 1);
  color: #475569;
}

.search-collapse-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

/* 响应式：小屏幕 */
@media (max-width: 768px) {
  .woodsper-search-layer {
    width: 100%;
    max-width: 100%;
    top: 5%;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  .woodsper-sidebar.collapsed ~ .woodsper-search-layer {
    transform: none;
  }

  .global-search-results {
    width: 100%;
    height: calc(100% - var(--woodsper-search-bar-height));
    border-radius: 0;
  }

  .search-collapse-btn {
    width: 100%;
  }
}
