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

/* 小屏优化（宽度 ≤ 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;
    }
  }
  
  
  
  /* ===================== 页面结构 ===================== */
  
  /* 顶部按钮区域 */
  .top-buttons {
    margin: 10px;
    text-align: center;
        position: absolute;
        top: 0;
        left: -10;
        width: 100%;
        display: flex;
        justify-content: flex-end;
        padding: 10px;
        background-color: rgba(0, 0, 0, 0.486); /* 半透明背景 */
        z-index: 1000; /* 确保在最前面 */
        gap: 10px;
  }

  body {
    padding-top: 60px; /* 根据.top-buttons的高度调整 */
  }

  .top-buttons button {
    position: center;
    background-color: #5e5e5e;
    color: rgb(255, 255, 255);
    border: none;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }
  
  .top-buttons button:hover {
    background-color: #000000;
  }
  /* 页脚 credit 信息 */
  .footer-credit {
    text-align: center;
    margin-top: 40px;
  }
  
  
  /* ===================== 角色选择条 ===================== */
  
  /* 顶部横条角色选择栏 */
  .character-selection-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to right, rgba(10,10,10,0.9), rgba(30,30,30,0.9));
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 12px;
    margin-top: 20px;
    gap: 20px;
    box-shadow: 0 0 8px rgba(126, 224, 255, 0.2);
  }
  
  /* 角色按钮（灰度未选） */
  .character-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.3s ease;
  }
  
  /* 选中角色样式 */
  .character-option.selected {
    filter: none;
    transform: scale(1.1);
  }
  
  /* 角色名称文字 */
  .character-label {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #77ddff;
    margin-top: 4px;
    text-shadow: 0 0 4px #000;
  }
  
  /* 角色头像小图（选择栏内） */
  .character-option img {
    width: 80px;
    height: auto;
    image-rendering: pixelated;
  }
  
  
  /* ===================== 角色立绘显示区 ===================== */
  
  /* 大图容器 */
  .character-portrait-container {
    display: flex;
    justify-content: center;
    margin-top: 12px;
  }
  
  /* 大头像图像 */
  #character-portrait {
    width: 180px;
    max-width: 90vw;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(126, 224, 255, 0.4);
    transition: opacity 0.4s ease;
  }
  
  /* 可单独控制某角色比例 */
  .character-gif.wana {
    transform: scale(0.65); 
  }
  
  
  /* ===================== 主对话界面 ===================== */
  
  /* 主对话布局容器 */
  .chat-interface {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    padding: 20px;
  }
  
  /* 每个角色容器（聊天 + 头像） */
  .character-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 300px;
  }
  
  /* 非激活角色隐藏 */
  .character-container:not(.active) {
    display: none;
  }
  
  /* 聊天头像区域 */
  .portrait-box {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
  
  /* 聊天头像 */
  .portrait {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 8px;
  }
  
  /* 输入框 */
  #user-input-zimno,
#user-input-wana {
  flex: 1;
  padding: 5px 8px;
  background: #000 !important;
  border: 1px solid #555;
  color: white;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: normal;
  outline: none;
}

#user-input-zimno::placeholder,
#user-input-wana::placeholder {
  color: #888;
  font-size: 10px;
}
  
.chat-form input[type="text"] {
    width: 80%;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 11px;
    background: #000 !important;
    border: 2px solid deeppink;  /* 粉红色边框 */
    color: white;
    font-family: system-ui, sans-serif;
    letter-spacing: normal;
    outline: none;
    border-radius: 4px;  /* 圆角更好看 */
    transition: border-color 0.3s ease;
  }
  
  .chat-form input[type="text"]:focus {
    border-color: hotpink;  /* 聚焦时颜色稍微变亮 */
    box-shadow: 0 0 6px hotpink; /* 聚焦时的发光效果 */
  }

  #chat-form button {
    font-family: system-ui, sans-serif;
    font-size: 11px;
    padding: 5px 12px;
    background-color: #444;
    color: white;
    border: 1px solid #555;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s ease;
  }
  
  #chat-form button:hover {
    background-color: #666;
  }
  /* 对话框记录 */
  .chat-log {
    height: 200px;         /* 固定高度，根据需要调整 */
    overflow-y: auto;      /* 超出内容出现垂直滚动条 */
    padding: 1px;          /* 内边距 */
    box-sizing: border-box;
    font-size: 14px;
    color: white;
  }

  /* ===================== 通用样式修复 ===================== */
  
  /* 保证被选中角色完全去除灰度 */
  .character.selected {
    filter: none;
  }