/* 3devotion 模块目录抽屉 (UIModuleDrawer) 样式 */
/* 符合 docs/PRODUCT-UX-ARCH.md v2 第 2.6、2.8 节设计 */

#moduleDrawer {
  position: fixed;
  left: 64px;
  top: 52px;
  bottom: 0;
  width: 320px;
  background: var(--chrome-bg-dark, #18181b);
  border-right: 1px solid var(--chrome-line-dark, #2f3033);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  z-index: var(--layer-stack-40, 400);
  display: flex;
  flex-direction: column;
  color: var(--chrome-ink-light, #e8eaed);
  font-family: var(--font-ui, system-ui, -apple-system, sans-serif);
  box-sizing: border-box;
  animation: drawerSlideIn .18s cubic-bezier(0.16, 1, 0.3, 1);
}

#moduleDrawer[hidden] {
  display: none !important;
}

@keyframes drawerSlideIn {
  from { transform: translateX(-16px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

#moduleDrawer .drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--chrome-line-dark, #2f3033);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#moduleDrawer .drawer-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#moduleDrawer .drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

#moduleDrawer .drawer-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: #9aa0a6;
  font-size: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .12s, color .12s;
}

#moduleDrawer .drawer-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#moduleDrawer .drawer-search-row {
  position: relative;
}

#moduleDrawer .drawer-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  border-radius: 8px;
  border: 1px solid #3c4043;
  background: #202124;
  color: #fff;
  font-size: 13px;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s;
}

#moduleDrawer .drawer-search-input:focus {
  border-color: #4285f4;
}

#moduleDrawer .drawer-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #9aa0a6;
  pointer-events: none;
}

#moduleDrawer .drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#moduleDrawer .drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#moduleDrawer .drawer-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9aa0a6;
  padding-left: 2px;
}

#moduleDrawer .drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

#moduleDrawer .drawer-big-card {
  grid-column: 1 / -1;
  height: 64px;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(66, 133, 244, 0.05));
  border: 1px solid rgba(66, 133, 244, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .1s;
}

#moduleDrawer .drawer-big-card:hover {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.25), rgba(66, 133, 244, 0.1));
  border-color: #4285f4;
  transform: translateY(-1px);
}

#moduleDrawer .big-card-icon svg {
  width: 24px;
  height: 24px;
}

#moduleDrawer .big-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#moduleDrawer .big-card-content strong {
  font-size: 13px;
  color: #fff;
}

#moduleDrawer .big-card-content span {
  font-size: 11px;
  color: #8ab4f8;
}

#moduleDrawer .drawer-tile {
  height: 68px;
  background: #202124;
  border: 1px solid #2f3033;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  color: #e8eaed;
  font-size: 11px;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, transform .1s;
}

#moduleDrawer .drawer-tile:hover {
  background: #2d2f34;
  border-color: #4285f4;
  transform: translateY(-1px);
}

#moduleDrawer .drawer-tile svg {
  width: 20px;
  height: 20px;
}

#moduleDrawer .drawer-tile span {
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* 搜索结果列表 */
#moduleDrawer .drawer-search-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#moduleDrawer .drawer-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #202124;
  border: 1px solid #2f3033;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .12s, border-color .12s;
}

#moduleDrawer .drawer-search-item:hover,
#moduleDrawer .drawer-search-item.is-first {
  background: #282a2d;
  border-color: #4285f4;
}

#moduleDrawer .search-item-icon svg {
  width: 20px;
  height: 20px;
}

#moduleDrawer .search-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

#moduleDrawer .search-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

#moduleDrawer .search-item-bc {
  font-size: 11px;
  color: #9aa0a6;
}

#moduleDrawer .drawer-empty {
  text-align: center;
  color: #9aa0a6;
  padding: 32px 0;
  font-size: 13px;
}

#moduleDrawer .drawer-tabs {
  display: none;
}

/* 手机端全屏抽屉适配 */
@media (max-width: 767.98px) {
  #moduleDrawer {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 70dvh;
    border-radius: 20px 20px 0 0;
    border-right: 0;
    border-top: 1px solid #2f3033;
    animation: drawerSheetUp .2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes drawerSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  #moduleDrawer .drawer-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }

  #moduleDrawer .drawer-tab {
    flex: none;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    border: 0;
    background: #2a2b2e;
    color: #bdc1c6;
    font-size: 13px;
    cursor: pointer;
  }

  #moduleDrawer .drawer-tab.is-active {
    background: #1e3a2a;
    color: #81c995;
    font-weight: 500;
  }
}
