/* ===================== 响应式布局 ===================== */

/* 小屏优化（宽度 ≤ 768px） */
@media screen and (max-width: 768px) {
    .chat-input {
      padding: 0 4px;
    }
  
    .chat-input input[type="text"] {
      font-size: 13px;
      padding: 5px 8px;
    }
  
    .chat-input button {
      padding: 5px 10px;
      font-size: 13px;
    }
  }
  
  /* 超小屏优化（宽度 ≤ 280px） */
  @media (max-width: 280px) {
    .chat-input {
      flex-direction: column;
    }
  
    .chat-input input[type="text"],
    .chat-input button {
      width: 100%;
      box-sizing: border-box;
    }
  
    .chat-input button {
      margin-top: 6px;
    }
  }

/* 右侧缩小面板 */
.selection-panel {
    position: relative; /* 使内部绝对定位元素参照 */
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 60%;
    background:
      url('../images/pixel-raster2.png'),
      linear-gradient(to bottom, rgba(10,10,10,0.95), rgba(5,5,5,0.95));
    background-size: cover;
    background-blend-mode: overlay;
    border-left: 2px solid #333;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 0 10px rgba(0, 255, 255, 0.2), inset 0 0 5px rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    /* 之前你用了 align-items/justify-content 居中，改成纵向排列 */
    padding: 0;
    overflow: hidden;
    backdrop-filter: blur(6px);
    z-index: 9;
}

/* 新增标题栏 */
.panel-header {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    color: #88f8ff;
    text-shadow: 0 0 4px #000;
    background: linear-gradient(to right, rgba(0,0,0,0.6), rgba(10,10,10,0.8), rgba(0,0,0,0.6));
    border-bottom: 1px solid #333;
    padding: 6px 0;
    user-select: none;
    flex-shrink: 0; /* 不缩小 */
    z-index: 3;
}

/* 滚动列表调整，顶部去掉 margin-top，避免和标题重叠 */
.image-scroll-list {
    width: 100%;
    height: 100%;
    margin-top: 0;
    padding: 4px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background-image: url('../images/pixel-raster2.png');
    background-repeat: repeat;
    background-size: contain;
    background-color: rgba(10, 10, 10, 0.85);
    scrollbar-width: thin;
    scrollbar-color: #77ddff transparent;
    flex-grow: 1; /* 填满剩余空间 */
}
  
  /* 卡带条标题栏 */
  .selection-panel::before {
    content: "Drink List";
    position: absolute;
    top: 4px;
    left: 0;
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    color: #88f8ff;
    text-shadow: 0 0 4px #000;
    background: linear-gradient(to right, rgba(0,0,0,0.6), rgba(10,10,10,0.8), rgba(0,0,0,0.6));
    border-bottom: 1px solid #333;
    padding: 0px 0;
    z-index: 3;
  }
  
  /* 自定义滚动条样式 */
  .image-scroll-list::-webkit-scrollbar {
    width: 6px;
  }
  .image-scroll-list::-webkit-scrollbar-track {
    background: transparent;
  }
  .image-scroll-list::-webkit-scrollbar-thumb {
    background-color: #55ccff;
    border-radius: 3px;
  }
  
  /* 图片按钮外壳：遮罩造型 */
  .image-mask {
    width: 120px;
    height: 60px;
    position: relative;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    transform: skewY(-8deg);
    transition: transform 0.2s ease, filter 0.3s ease;
    filter: grayscale(100%);
    cursor: pointer;
    border-radius: 6px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.05);
  }
  .image-mask:hover {
    transform: scale(1.05) skewY(-8deg);
    filter: grayscale(50%);
  }
  .image-mask.selected {
    filter: grayscale(0%);
    transform: scale(1.1) skewY(-8deg);
    z-index: 2;
  }
  
  /* 小图像本体 */
  .selectable-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    pointer-events: none;
    filter: grayscale(100%) brightness(0.6);
    transition: all 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
  }
  .selectable-image:hover {
    transform: scale(1.05);
    filter: grayscale(70%) brightness(1);
  }
  .selectable-image.selected {
    filter: none;
    transform: scale(1.1);
    box-shadow: 0 0 10px #77ddff;
  }
  
  /* 右侧大图展示 */
  .preview-float {
    display: none;
    position: absolute;
    top: 80px;
    right: 30px;
    width: 300px;
    min-height: 220px;
    background-repeat: repeat;
    background-size: contain;
    background-color: rgba(30, 30, 40, 0.85);
    border: 1.5px solid #7ee0ff;
    border-radius: 12px;
    box-shadow: 0 0 12px rgba(126, 224, 255, 0.3);
    backdrop-filter: blur(6px);
    padding: 0px;
    z-index: 10;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #e0faff;
    font-family: 'Courier New', monospace;
    animation: fadeIn 0.3s ease;
  }
  
  /* 光栅动画叠层 */
  .raster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url('../images/pixel-raster.png');
    background-repeat: repeat;
    background-size: contain;
    opacity: 0.1;
    animation: scrollRaster 8s linear infinite;
    z-index: 1;
  }
  
  /* 预览内容结构 */
  .preview-float img {
    width: 90%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(126, 224, 255, 0.2);
  }
  #preview-text {
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
    padding: 0 4px;
    color: #ccc;
    margin-top: 8px;
  }
  .preview-box {
    width: 100%;
    height: 40%;
    text-align: center;
    margin-bottom: 10px;
  }
  #preview-image {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 5px #444);
  }

  /* 容器外壳 */
  .drink-drawer {
    position: fixed;
    top: 80px;
    right: 0;
    height: calc(100% - 80px);
    display: flex;
    align-items: flex-start;
    transition: transform 0.3s ease;
    z-index: 10;
  }
  
  /* 面板本体 */
  .drink-drawer .selection-panel {
    background-color: #1e1e1e;
    width: 80px;
    height: 50%;
    padding: 10px;
    overflow-y: auto;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
  }

  .drink-drawer.closed {
    transform: translateX(100%);
  }
  
  /* 显示 drawer toggle 按钮样式（可视化） */
  #drawer-toggle {
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 60px;
    background-color: #333;
    border: none;
    cursor: pointer;
    border-radius: 6px 0 0 6px;
    box-shadow: 0 0 5px rgba(0,255,255,0.4);
  }
  /* 抽屉按钮样式 */
  #drawer-toggle {
    position: absolute;
    top: 50%;
    left: -32px;             /* 负值，刚好放在面板左边缘外 */
    transform: translateY(-50%) translateX(0); /* 取消横向偏移 */
    width: 32px;
    height: 80px;
    background: #111;
    color: white;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 10px;
    border-radius: 6px 0 0 6px;
    box-shadow: 0 0 5px rgba(0,255,255,0.4);
    z-index: 1001;
    transition: background 0.3s;
  }
  
  .drink-drawer.closed #drawer-toggle::after {
    content: '▶'; /* 收起时向右 */
  }
  
  #drawer-toggle::after {
    content: '◀'; /* 展开时向左 */
    display: block;
    font-size: 20px;
    transform: rotate(0deg);
  }
  
  /* 关键收起动作 - 整个面板往右隐藏 */
  @media (max-width: 768px) {
    .drink-drawer.closed {
      transform: translateX(100%);
    }
  }
  
  /* 动画 */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes scrollRaster {
    from { background-position: 0 0; }
    to { background-position: 0 100px; }
  }