/* ==========================================================================
   抽屉组件 (Drawer)
   ========================================================================== */

  /* 遮罩层 */
  .zuoekai-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
      linear-gradient(180deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.28)),
      rgba(255, 255, 255, 0.12);
    z-index: var(--zuoekai-z-drawer-overlay, 1500);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(10px) saturate(120%);
  }

  .zuoekai-drawer-overlay--visible {
    opacity: 1;
    visibility: visible;
}

/* 抽屉主体 */
  .zuoekai-drawer {
    position: fixed;
    top: 18px;
    right: 18px;
    height: calc(100% - 36px);
    width: 400px; /* Default width */
    max-width: 90vw;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(248, 250, 252, 0.66));
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 16px;
    box-shadow:
      0 24px 60px rgba(15, 23, 42, 0.16),
      0 8px 24px rgba(59, 130, 246, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    overflow: hidden;
    z-index: var(--zuoekai-z-drawer, 1501);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

/* 激活状态 */
.zuoekai-drawer--visible {
  transform: translateX(0);
}

/* --- 结构 (Structure) --- */

  .zuoekai-drawer__header {
    padding: 6px 18px 6px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  }

  .zuoekai-drawer__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--zuoekai-color-text);
    letter-spacing: -0.02em;
  }

  .zuoekai-drawer__close {
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 8px;
    margin-right: -2px;
    color: var(--zuoekai-color-text-secondary);
    border-radius: 14px;
    transition: background-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: flex;
  }

  .zuoekai-drawer__close:hover {
    background-color: rgba(255, 255, 255, 0.58);
    color: var(--zuoekai-color-text);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  }

  .zuoekai-drawer__body {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
  }

  .zuoekai-drawer__footer {
    padding: 18px 24px 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.24));
  }

/* --- 尺寸变体 (Sizes) --- */

.zuoekai-drawer--sm { width: 320px; }
.zuoekai-drawer--lg { width: 640px; }
.zuoekai-drawer--xl { width: 960px; }

/* --- 方位变体 (Positions) --- */

  /* 左侧抽屉 */
  .zuoekai-drawer--left {
    right: auto;
    left: 18px;
    transform: translateX(-100%);
  }

  .zuoekai-drawer--left.zuoekai-drawer--visible {
    transform: translateX(0);
  }

/* ==========================================================================
   响应式适配 - 小屏幕设备
   在 640px 以下抽屉接近全屏宽度，缩小圆角和内边距，
   确保移动端可用性。
   ========================================================================== */
@media (max-width: 640px) {
  /* 小屏幕下抽屉接近全屏 */
  .zuoekai-drawer {
    top: 8px;
    right: 8px;
    height: calc(100% - 16px);
    width: calc(100% - 16px);
    max-width: none;
    border-radius: 18px;
  }

  /* 左侧抽屉同样处理 */
  .zuoekai-drawer--left {
    left: 8px;
    right: auto;
  }

  /* 缩小内部间距 */
  .zuoekai-drawer__header {
    padding: 6px 18px 6px;
  }

  .zuoekai-drawer__body {
    padding: 3px;
  }

  .zuoekai-drawer__footer {
    padding: 14px 18px 16px;
  }

  .zuoekai-drawer__title {
    font-size: 18px;
  }
}
