:root {
  color-scheme: light dark;
  /* 优化后的亮色主题 */
  --bg-page: #fafbfd;
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: rgba(255, 255, 255, 1);
  --bg-sidebar: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-sidebar-alpha: rgba(102, 126, 234, 0.95);
  --border: rgba(99, 102, 241, 0.08);
  --border-strong: rgba(99, 102, 241, 0.15);
  --text: #1a202c;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --text-inverted: #ffffff;
  --accent: #6366f1;
  --accent-hover: #5855eb;
  --accent-soft: rgba(99, 102, 241, 0.1);
  --accent-border: rgba(99, 102, 241, 0.2);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-elevated: 0 20px 40px -10px rgba(99, 102, 241, 0.15);
  --sidebar-width: clamp(280px, 28vw, 360px);
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --max-content-width: 1400px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 16px;
}

body.dark {
  /* 优化后的暗色主题 */
  --bg-page: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.9);
  --bg-card-hover: rgba(30, 41, 59, 1);
  --bg-sidebar: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  --bg-sidebar-alpha: rgba(30, 41, 59, 0.98);
  --border: rgba(148, 163, 184, 0.1);
  --border-strong: rgba(148, 163, 184, 0.2);
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverted: #0f172a;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-soft: rgba(129, 140, 248, 0.15);
  --accent-border: rgba(129, 140, 248, 0.3);
  --shadow-elevated: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: linear-gradient(135deg, #f0f4f8 0%, #e6ebf5 100%);
  color: var(--text);
  line-height: 1.6;
  transition: var(--transition);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(244, 246, 251, 0.82));
  max-width: var(--max-content-width);
  margin: 1rem auto;
  max-height: calc(100vh - 2rem);
  box-shadow: 0 0 60px -20px rgba(15, 23, 42, 0.15);
  border-radius: var(--border-radius);
  overflow: hidden;
}

@media (max-width: 1240px) {
  .app-shell {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }
}

@media (max-width: 980px) {
  .app-shell {
    margin: 0;
    max-height: none;
    border-radius: 0;
  }
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: var(--text-inverted);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.15);
}

.brand {
  padding: 2.25rem 2rem 1.25rem;
}

.brand h1 {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  color: var(--text-inverted);
}

body.dark .brand h1 {
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.brand .tagline {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(226, 232, 240, 0.78);
}

body.dark .brand .tagline {
  color: rgba(241, 245, 249, 0.85);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.75rem 2.5rem;
  scrollbar-width: thin;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

.tree-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tree-list li {
  margin: 0;
  padding: 0;
}

.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem; padding-left: calc(0.6rem + var(--depth, 0) * 0.9rem);
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
  position: relative;
}

/* 移除之前的展开按钮样式，使用小三角 */

.tree-item:hover {
  background: rgba(148, 163, 184, 0.18);
  transform: translateX(2px);
}

.tree-label {
  flex: 1;
  font: inherit;
  font-weight: 550;
  color: rgba(248, 250, 252, 0.95);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.dark .tree-label {
  color: rgba(241, 245, 249, 0.98) !important;
}

body.dark .tree-count {
  color: rgba(203, 213, 225, 0.9) !important;
}

.tree-arrow {
  margin-left: 0.3rem;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.8);
  transition: transform 0.2s ease;
}

.tree-label span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tree-label .tree-depth {
  display: inline-block;
  width: calc(var(--depth) * 0.4rem);
}

.tree-count {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  color: rgba(248, 250, 252, 0.9);
}

.tree-label.active + .tree-count,
.tree-label.active {
  color: var(--accent);
}

.tree-children {
  margin: 0.2rem 0 0.2rem 0.85rem;
  padding-left: 0.8rem;
  border-left: 1px dashed rgba(148, 163, 184, 0.28);
  transition: all 0.3s ease;
}

.tree-children.collapsed {
  display: none !important;
}

.tree-children .tree-item {
  padding: 0.35rem 0.55rem;
}

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.6);
  border-left: 1px solid var(--border);
  overflow: hidden; /* 防止整个面板溢出 */
}

body.dark .main-panel {
  background: rgba(15, 23, 42, 0.3);
}

.main-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 2.25rem clamp(1.5rem, 4vw, 2.75rem) 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: contents; /* 让子元素直接参与grid布局 */
}

.search-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0; /* 允许shrink */
}

#search-input {
  width: 100%;
  max-width: 600px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  background: var(--bg-card);
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 30px -25px rgba(15, 23, 42, 0.4);
}

body.dark #search-input {
  box-shadow: 0 10px 30px -25px rgba(99, 102, 241, 0.35);
}

#search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.meta-area {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  justify-self: end; /* 在grid中靠右对齐 */
}

.meta-label {
  display: none; /* 隐藏最后更新时间，将在底部显示 */
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px -6px rgba(15, 23, 42, 0.2);
}

.theme-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 16px -8px rgba(99, 102, 241, 0.4);
}

.theme-icon {
  font-size: 1.1rem;
  transition: var(--transition);
}

body.dark .theme-icon {
  transform: rotate(180deg);
}

.context-header {
  padding: 0  clamp(1.5rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.view-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 650;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  display: inline-block;
}

body.dark .view-title {
  background: rgba(30, 41, 59, 0.9);
  color: var(--text);
}

.view-crumbs {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.card-section {
  flex: 1;
  padding: 1.5rem clamp(1.5rem, 4vw, 2.75rem) 2rem;
  overflow-y: auto; /* 允许书签内容垂直滚动 */
  overflow-x: hidden; /* 防止水平滚动 */
}

.bookmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.bookmark-card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 0.95rem 1.05rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-elevated);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

.folder-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.folder-card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 40px -28px rgba(79, 70, 229, 0.55);
}

.folder-icon {
  background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(99, 102, 241, 0.2) 100%);
  color: var(--accent);
  font-size: 14px;
}

.bookmark-card:hover,
.bookmark-card:focus {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg);
  outline: none;
  background: var(--bg-card-hover);
}

.bookmark-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  opacity: 0;
  transition: var(--transition-fast);
}

.bookmark-card:hover::before {
  opacity: 1;
}

.bookmark-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-weight: 650;
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
  font-size: 16px;
  position: relative;
  transition: var(--transition-fast);
}

.bookmark-card:hover .bookmark-icon {
  background: var(--accent-border);
  transform: scale(1.1);
}

.bookmark-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookmark-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.bookmark-title {
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  transition: var(--transition-fast);
  margin-bottom: 0.3rem;
}

.bookmark-card:hover .bookmark-title {
  color: var(--accent-hover);
}

.bookmark-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition-fast);
}

.bookmark-card:hover .bookmark-meta {
  color: var(--text);
}

.empty-state {
  padding: 3rem 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==== Mac 程序坞样式 ==== */

.dock-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  padding: 0 clamp(1.5rem, 4vw, 2.75rem);
}

.dock-wrapper {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  padding: 8px 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 
              0 1px 3px rgba(0, 0, 0, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
}

body.dark .dock-wrapper {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 
              0 1px 3px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(148, 163, 184, 0.2);
}

.bookmark-dock {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 56px;
}

.dock-item {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.dark .dock-item {
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dock-item:hover {
  transform: scale(1.2) translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dock-item img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

/* 程序坞文字fallback样式优化 */
.dock-item {
  font-size: 18px;
  font-weight: bold;
  color: var(--accent);
}

body.dark .dock-item {
  color: var(--accent);
}

.dock-item.dock-trash {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 20px;
}

body.dark .dock-item.dock-trash {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.dock-item.dock-trash:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.3) translateY(-6px);
}

.dock-item.dock-trash.drag-over {
  background: rgba(239, 68, 68, 0.3);
  transform: scale(1.4) translateY(-8px);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.3);
}

/* 程序坞项目动画 */
.dock-item.adding {
  animation: dockItemAdd 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.dock-item.removing {
  animation: dockItemRemove 0.4s ease-in-out forwards;
}

@keyframes dockItemAdd {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
  }
  60% {
    transform: scale(1.2) translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dockItemRemove {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.1) translateY(-20px);
  }
}

/* 右键菜单样式 */
.context-menu {
  position: fixed;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 160px;
  overflow: hidden;
}

body.dark .context-menu {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: var(--text);
}

.context-menu-item:hover {
  background: rgba(99, 102, 241, 0.1);
}

body.dark .context-menu-item:hover {
  background: rgba(129, 140, 248, 0.1);
}

.context-menu-item span {
  margin-right: 4px;
}


/* 右键菜单分隔线 */
.context-menu-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

body.dark .context-menu-separator {
  background: rgba(148, 163, 184, 0.2);
}

.view-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}


@media (max-width: 980px) {
  .app-shell {
    flex-direction: column;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0;
  }

  .brand {
    padding: 1.5rem 1.25rem 0.75rem;
  }

  .sidebar-scroll {
    padding: 0 1.25rem 1.5rem;
    max-height: 50vh;
  }

  .tree-list {
    display: block;
  }

  .tree-item {
    flex-direction: row;
    align-items: center;
    padding: 0.6rem 0.75rem;
  }

  .tree-children {
    border: none;
    padding-left: 0.8rem;
    margin-left: 0;
  }

  .main-panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .main-header {
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .search-area {
    width: 100%;
  }

  .meta-area {
    justify-content: space-between;
  }

  .context-header {
    padding: 0 1.25rem;
  }

  .card-section {
    padding: 1.25rem 1.25rem 1.5rem;
    /* 继承滚动设置 */
  }
  
  .dock-container {
    padding: 0 1.25rem;
  }
}

@media (max-width: 640px) {
  .brand h1 {
    font-size: 1.5rem;
  }

  .brand .tagline {
    font-size: 0.85rem;
  }

  .main-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1rem 0.75rem;
  }

  #search-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }

  .theme-toggle {
    padding: 0.5rem;
  }

  .view-title {
    font-size: 1.25rem;
  }

  .view-crumbs {
    font-size: 0.8rem;
  }

  .card-section {
    padding: 1rem 1rem 1.25rem;
    /* 继承滚动设置 */
  }
  
  .dock-container {
    padding: 0 1rem;
    margin-bottom: 1rem;
  }
  
  .dock-item {
    width: 42px;
    height: 42px;
  }
  
  .dock-item img {
    width: 28px;
    height: 28px;
  }

  .bookmark-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .bookmark-card {
    padding: 0.8rem 0.9rem;
    gap: 0.7rem;
  }

  .bookmark-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .bookmark-title {
    font-size: 0.9rem;
  }

  .bookmark-meta {
    font-size: 0.75rem;
  }

}

.tree-item.active {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1a202c !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  border: 2px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.dark .tree-item.active {
  background: rgba(30, 41, 59, 0.95) !important;
  color: #ffffff !important;
  border: 2px solid rgba(129, 140, 248, 0.6) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.tree-item.active .tree-count {
  background: rgba(99, 102, 241, 0.8) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

body.dark .tree-item.active .tree-count {
  background: rgba(129, 140, 248, 0.9) !important;
  color: #1a202c !important;
}

/* ==== 移动端专用样式 ==== */

/* 汉堡菜单按钮 */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

@media (max-width: 980px) {
  .mobile-menu-toggle {
    top: 1rem;
    right: 1rem;
    left: auto;
  }
}

.mobile-menu-toggle:hover {
  background: var(--bg-card-hover);
  transform: scale(1.05);
  box-shadow: var(--shadow-elevated);
}

.mobile-menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
  border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* 移动端遮罩层 */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.mobile-overlay.active {
  opacity: 1;
}

/* 侧边栏头部优化 */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2rem 2rem 1rem;
}

.sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--text-inverted);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: -0.5rem;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 移动端响应式布局 */
@media (max-width: 980px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .mobile-overlay.active {
    display: block;
  }
  
  .sidebar-close {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .app-shell {
    position: relative;
    margin: 0;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-elevated);
    border-right: none;
  }
  
  .sidebar.active {
    left: 0;
  }
  
  .main-panel {
    width: 100%;
    padding-top: 80px;
    padding-right: 70px;
    border-left: none;
  }
  
  .main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border);
  }
  
  .header-top {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .meta-area {
    justify-content: center;
  }
  
  .context-header {
    margin-top: 1rem;
    padding: 0 1.5rem;
  }
  
  .card-section {
    padding: 1.5rem 1.5rem 1.75rem;
  }
  
  .dock-container {
    padding: 0 1.5rem;
  }
  
  .bookmark-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .bookmark-card {
    padding: 1.2rem;
    border-radius: var(--border-radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition-fast);
  }
  
  .bookmark-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }
}

