/* 全局样式设置 */
body {
  /* 自定义背景颜色，这里使用浅灰色 */
  background-color: #202020;
  /* 自定义字体颜色，这里使用深灰色 */
  color: #ffffff;
  /* 自定义字体样式，这里使用 Arial 字体，如果没有则使用 sans-serif 通用字体 */
  font-family: Arial, sans-serif;
  /* 自定义字体大小，这里使用 16px */
  font-size: 16px;
  /* 自定义行高，这里使用 1.6 倍字体大小 */
  line-height: 1.6;
  margin: 0;
  padding: 0;
  width: 100%;
}

/* 定义一个 CSS 变量，用于存储底部容器的高度 */
:root {
  --bottom-container-height: 0px;
  --sidebar-width: 260px;
  --card-min: 220px; --grid-gap: 12px;
}
/* 全局滚动条基础设置 */
html {
  scrollbar-width: thin; /* 支持Firefox的滚动条宽度控制:ml-citation{ref="4,6" data="citationList"} */
  scrollbar-color: #888 #ffffff00; /* 滑块颜色/轨道颜色（Firefox）:ml-citation{ref="6" data="citationList"} */
}

/* 1) 预留滚动条空间，避免内容区域宽度因滚动条出现/隐藏而变化 */
/* html { scrollbar-gutter: stable both-edges; } */

/* 左侧导航栏 */
.search-sidebar {
  /* 使用固定定位，侧边栏会固定在浏览器窗口的指定位置，不随页面滚动而移动 */
  position: fixed;
  /* 将侧边栏固定在浏览器窗口的左侧边缘 */
  left: 0;
  /* 侧边栏从浏览器窗口的顶部开始显示 */
  top: 0px;
  /* 侧边栏延伸到浏览器窗口的底部 */
  bottom: 0;
  /* 设置侧边栏的宽度为 280 像素 */
  width: var(--sidebar-width);
  /* 设置侧边栏的背景颜色为 #f8f9fa，这是一个比较浅的灰色系，通常用于界面的次要区域 */
  background: #171717;
  /* 为侧边栏内部的内容添加 1rem 的内边距，使内容不会紧贴着边框 */
  padding: 0rem;
  /* 当侧边栏内的内容超出其高度时，显示垂直滚动条，方便用户查看全部内容 */
  overflow-y: auto;
  /* 使用 Flexbox 布局，使侧边栏内的子元素可以垂直排列 */
  display: flex;
  /* 指定 Flexbox 布局的方向为垂直方向，子元素将从上到下依次排列 */
  flex-direction: column;
  padding: 0.75rem;
  z-index: 100;
  box-shadow: inset 0px -1px 2px 0px #303030;
}
.hidden {
  display: none;
}

/* 左侧功能栏组 */
.nav-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 1rem 0;
}

/* 预选区域 */
.preset-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 1px solid #eee;
  padding: 1rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* 预选网格布局 */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  max-height: 610px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

/* 预选卡片 */
/* preset.css */
.preset-container {
  position: relative;
  height: calc(100vh - 200px);
  overflow-y: auto;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding: 12px;
}

.preset-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.preset-card:hover {
  transform: translateY(-2px);
}

.preset-thumbnail {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}

.remove-preset-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-preset-btn svg {
  width: 18px;
  height: 18px;
  fill: #dc3545;
}

.preset-bottom {
  /* 保持原有定位样式 */
  position: fixed;
  bottom: 0;
  left: 10px;
  padding: 0.5rem;
  align-items: center;
  z-index: 50;
  /* 新增间距控制 */
  gap: 0.25rem; /* 替代原gap-4，更精确控制 */
   /* 新增宽度约束 */
  width: 100%;
  box-sizing: border-box;
  max-width: 235px; /* 根据实际需求调整 */
  /* 弹性布局优化 */
  display: flex;
  justify-content: center;
}
.preset-bottom-select,
.preset-action-btn {
  /* 修改为弹性增长 */
  flex: 1 1 auto;
  max-width: 240px; /* 控制最大宽度 */
}

/* 统一输入控件样式 */
.preset-bottom-select,
.preset-action-btn {
  min-width: 120px;  /* 统一最小宽度 */
  height: 40px;      /* 统一高度 */
  padding: 0 1rem;   /* 统一横向内边距 */
  font-size: 14px;   /* 统一字号 */
  line-height: 1.5;  /* 统一行高 */
  border-radius: 2rem;
  transition: all 0.2s ease;
}

/* 下拉菜单专属样式 */
.preset-bottom-select {
  background-color: #202020;
  color: #ffffff;
  border: 1px solid #4b5563;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

/* 按钮基础样式 */
.preset-action-btn {
  background-color: #1e3a8a; /* 深蓝基础色 */
  color: white;
  border: 1px solid #1e3a8a;
  cursor: pointer;
}

/* 悬停交互状态 */
.preset-bottom-select:hover,
.preset-action-btn:hover {
  /*background-color: #1e3a8a; /* 深蓝色 */
  transform: translateY(-2px);
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* 焦点状态 */
.preset-bottom-select:focus {
  outline: none;
  outline-offset: 2px;
}

/* 如果需修改选项本身的焦点颜色 */
.preset-bottom-select option:focus,
.preset-bottom-select option:checked {
  appearance: none;
  background: #1e3a8a linear-gradient(0deg, #1e3a8a 0%, #1e3a8a 100%);
  color: white;
}


/* /预选区域 */

/* 主要右侧内容控制 */
/* 该选择器用于设置主要右侧内容区域的样式 */
.search-main-content {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-left: var(--sidebar-width);
  /* 设置顶部外边距为 56px，可能是为了避免内容与顶部导航栏重叠 */
  margin-top: 82px;
  /* 设置内边距为 2rem，使内容与容器边缘保持一定距离 */
  padding: 0.2rem;
  height: calc(100vh - 82px);
}
/* 顶部导航栏管理容器 */
.search-top-navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  width: calc(100% - 260px);
  z-index: 100;
  background-color: #202020;
}
.scroll-wrapper{
  flex: 1;                     /* 占满剩余空间 */
  overflow-y: auto;             /* 只在这层滚动 */
  max-height: calc(100vh - var(--bottom-container-height) - 120px);
  scrollbar-gutter: stable both-edges;
  display: flex;
  flex-direction: column;
  overflow: auto;
  container-name: scroll;
}

/*显示区域管理*/
.display-container {
  /* 启用弹性布局 */
  display: flex;
  /* 垂直排列子元素 */
  flex-direction: column;

  /* 水平居中 */
  margin: 0 auto;
  /* 固定宽度并限制最大宽度 
  width: 60%;*/
  /* 最大宽度 */
  width: 960px;
  /* 最小宽度 */
  /* 内容从顶部开始排列 */
  justify-content: flex-start;
  /* 子元素间距 */
  gap: 0.5rem;

  /* 移除不必要的定位 */
  flex: none; /* 占据剩余空间 */
  min-height: 200px; /* 最小可视高度 */
  align-items: stretch; /* 显式设置拉伸对齐 */
  z-index: 10;
}
.message {
  padding: 16px 24px;
  border-radius: 12px;
  /* 限制消息框最大宽度 */
  max-width: 85%;
  /* 自动换行 */
  word-break: break-word;
}
.user-message {
  background-color: #303030;
  color: white;
  /* 右侧对齐 */
  margin-left: auto;
  /* 右侧圆角优化 */
  border-radius: 20px 20px 0 20px;
}
.result-message {
  background-color: #f8f9fa;
  color: #f8f8f8;
  /* 左侧对齐 */
  margin-right: auto;
  /* 左侧圆角优化 */
  border-radius: 20px 20px 20px 0;
  align-self: flex-end; /* 用户消息右对齐 */
}
.\@container\/thread {
    container-type: inline-size;
}/* 新增响应式规则 */
@media (max-width: 1260px) {
  .display-container {
     width: 100%;
    padding: 1rem 0.5rem;
  }
  .message {
    max-width: 92%;
  }
}

/*-------回复窗口内容-------------*/
/* 2) 固定卡片纵横比，图片加载前容器高度就确定，避免布局偏移 */
.result-grid .image-container { aspect-ratio: 4 / 3; position: relative; }
.result-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 4) 占位的 loading 层绝对定位，不要撑开布局 */
.loading-indicator { position: absolute; inset: 0; display: grid; place-items: center; }
.result-message{width: 100%;;background:#171717;border-radius:14px;padding:12px;margin-top:12px;display:flex;flex-direction:column;gap:12px}
.result-header{display:flex;gap:12px;color:#9ba3af;font-size:12px}
.result-controls{display:flex;gap:8px;align-items:center;justify-content:flex-end;padding-top:8px}
.result-controls button{background:#1d2841;color:#eaeaea;border:1px solid #2a3a5f;padding:6px 10px;border-radius:8px;cursor:pointer}
.result-controls button:disabled{opacity:.45;cursor:not-allowed}
.result-grid .result-card {
  box-sizing: border-box;
  border: 1px solid transparent;  /* 默认就占好边框的位置，hover 不会变宽 */
  border-radius: 8px;
  overflow: hidden;
  background: #202020;
  min-width: 0; /* 防止内容过长把列撑爆 */
}
.result-grid .result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;            /* 没有真实尺寸时用占位纵横比；有就写 width/height 属性 */
  object-fit: cover;
  background: #202020;            /* 提前撑开空间，暗底占位 */
}
.result-grid .result-card:hover {
  border-color: #2a3a5f;          /* 只改颜色，不改厚度 */
}
/* 图片显示区域 */
/* 结果网格布局 */
.result-grid {
  display: grid;
  gap: 1.5rem;
  /* 卡片最小 220px，当空间不够就少一列；够宽时每列尽量平均 */
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  contain: layout paint; 
  padding: 1rem;
}
/* 图片卡片 */
/* 图片卡片容器 */
.result-card {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
  cursor: pointer;
}
.result-card:hover {
  transform: translateY(-2px);
}
/* 图片链接 */
.image-link {
  display: block;
  text-decoration: none;
}
/* 预选按钮容器 */
.select-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.result-card:hover .select-overlay {
  opacity: 1;
}
/* 加号按钮样式 */
.select-button {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.select-button:hover {
  background: #fff;
  transform: scale(1.1);
}
/* 加号图标 */
.add-icon {
  width: 20px;
  height: 20px;
  fill: #007bff;
}
/* 保持原有懒加载样式 */
.image-container img.lazy-load {
  width: 100%;
  height: 250px; /* 固定高度 */
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s;
}
.image-container img.lazy-load.loaded {
  opacity: 1;
}

/*-------/回复窗口内容-------------*/

/* 大图片显示区域 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 400px;
}
.modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 底部控制 */ 
/* 底部控制容器样式 */
.bottom-control-container {
  /* 固定定位，相对于浏览器窗口 */
  position: fixed;
  /* 容器底部与浏览器窗口底部对齐 */
  bottom: 0;
  /* 容器左侧与浏览器窗口左侧对齐 */
  left: var(--sidebar-width);
  /* 容器右侧与浏览器窗口右侧对齐 */
  right: 0;
  /* 自定义容器高度，这里设置为 80px，你可以根据需要修改 */
  height: calc(100vh); 
  /* 容器内边距，四周均为1rem */
  padding: 1rem; 
  /* 使用 Flexbox 布局 */
  display: flex;
  /* 垂直居中对齐 */
  align-items: center;
  /* 水平居中对齐 */
  justify-content: center; 
  z-index: 50;
}
/* 底部控制容器样式行动后 */
.bottom-control-container.active {
  /* 固定定位，相对于浏览器窗口 */
  position: fixed;
  /* 容器底部与浏览器窗口底部对齐 */
  bottom: 0;
  /* 容器左侧与浏览器窗口左侧对齐 */
  left: var(--sidebar-width);
  /* 容器右侧与浏览器窗口右侧对齐 */
  right: 0;
  /* 容器内边距，四周均为1rem */
  padding: 1rem;
  height: auto;
  padding: 1rem; 
  z-index: 50;
  /* 使用 Flexbox 布局 */
  display: flex;
  /* 垂直居中对齐 */
  align-items: center;
  /* 水平居中对齐 */
  justify-content: center; 
}

/* 搜索输入容器 */
.search-control {
  width: 700px;
  gap: 10px; /* 子元素之间的间距 */
}
/* 初始状态样式 */
.search-input-container {
  display: flex;          /* 启用弹性布局模型 */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
    width: 100%;
    margin: 0 auto;        /* 水平居中定位 */
    padding: 3px 12px 45px 12px; /* 右侧留出按钮空间 */
    border-radius: 24px;   /* 超大圆角塑造现代感 */
    background: rgba(255, 255, 255, 0.082);
}
/* 通用搜索输入框样式 */
.universal-search-input {
  width: 100%;            /* 相对父容器宽度80%，保持呼吸感 */ 
  margin: 0 auto;        /* 水平居中定位 */
  font-size: 16px;       /* 标准阅读字号 */
  padding: 12px 12px; /* 右侧留出按钮空间 */
  border-radius: 24px;   /* 超大圆角塑造现代感 */
  overflow-y: hidden; /* 默认隐藏滚动条 */
  text-align: left; /* 内容从左上开始 */
  border: 2px solid #007bff15; /* 使用品牌主色作为焦点指示 */
  border: none;
  outline: none;
  resize: none;
  background: rgba(255, 255, 255, 0);
  transition: all 0.2s ease; /* 过渡目标改为all */
}
/* 达到最大高度时显示滚动条 */
.universal-search-input.scroll-active {
overflow-y: auto;
}
    
  
  
/* 底部控制栏样式（发送按钮+文件选择按钮容器） */
.search-control-bar {
  position: absolute;     /* 绝对定位脱离文档流 */
  right: 32px;           /* 距离输入框右侧32像素 */
  bottom: 6px;           /* 距离输入框底部24像素 */
  display: flex;          /* 启用弹性布局排列子元素 */
  gap: 12px;              /* 按钮间距12像素 */
  align-items: center;    /* 垂直居中对齐子元素 */
  z-index: 1;             /* 确保按钮显示在输入框内容上层 */
}
  .file-picker-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 6px;
    transition: opacity 0.2s;
  }
  .send-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    cursor: pointer;
    transition: background 0.2s;
  }
  .hidden-file-input {
    display: none;
  }
  /* 交互状态 */
  .send-btn:hover {
    background: #0056b3;
  }
  .file-picker-btn:hover {
    opacity: 0.8;
  }

/* 管理填充内容按钮的组 */
.example-questions-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; /* 等同于 Tailwind 的 gap-2 */
  /* 容器居中 */
  margin: 0 auto; 
  /* 上下左右填充 */
  padding: 1rem; 
  /* 限制最大宽度 */
  max-width: 700px; 
}
/* 管理按钮样式 */
.example-question-btn {
  padding: 0.25rem 0.75rem; /* 等同于 Tailwind 的 px-3 py-1 */
  background-color: #f3f4f600; /* 等同于 Tailwind 的 bg-gray-100 */
  border-radius: 9999px; /* 等同于 Tailwind 的 rounded-full */
  font-size: 0.875rem; /* 等同于 Tailwind 的 text-sm */
  color: #d8d8d8; /* 等同于 Tailwind 的 text-gray-700 */
  border: 1px solid #e5e7eb; /* 1px 灰色边框，你可以根据需要调整颜色和宽度 */
  box-shadow: 0 1px 1px rgba(255, 255, 255, 0.651); 
  transition: all 0.1s ease; /* 过渡效果，使点击反馈更平滑 */
}
.example-question-btn:hover {
  background-color: #c5c5c5dc; /* 等同于 Tailwind 的 hover:bg-gray-200 */
  color: #242424; /* 等同于 Tailwind 的 text-gray-700 */
  box-shadow: 0 2px 2px rgba(255, 255, 255, 0.651); 
}
/* 添加按钮点击效果 */
.example-question-btn:active {
  background-color: #a0a0a0; /* 点击时的背景颜色，可根据需求调整 */
  box-shadow: 0 0px 0px rgba(255, 255, 255, 0.651); 
  color: #242424; /* 点击时的文字颜色，可根据需求调整 */
  transform: scale(0.98); /* 点击时缩小按钮，增加点击反馈 */
  transition: all 0.1s ease; /* 过渡效果，使点击反馈更平滑 */
}

/* 响应式规则 */
@media (max-width: 768px) {
  .search-sidebar:not(.hidden) {
    z-index: 200; /* 确保侧边栏在顶层 */
  }
  .search-main-content {
    margin-left: 0;
    width: 100%;
  }
  .search-top-navbar {
    width: 100%;
  }
  .display-container {
    width: 100%;
    padding: 1rem 0.5rem;
  }
  .bottom-control-container,
  .bottom-control-container.active {
    left: 0;
  }
}


/* From Uiverse.io by Na3ar-17 */ 
.radio-input {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.radio-input * {
  box-sizing: border-box;
  padding: 0;
}
.radio-input label {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0px 10px;
  width: 220px;
  cursor: pointer;
  height: 45px;
  position: relative;
}
.radio-input label::before {
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 45px;
  z-index: -1;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border-radius: 10px;
  border: 2px solid transparent;
}
.radio-input label:hover::before {
  transition: all 0.2s ease;
  background-color: #202020ab;
}
.radio-input .label:has(input:checked)::before {
  background-color: #212121;
  border-color: #212121;
  height: 45px;
}
.radio-input .label .text {
  color: #fff;
}
.radio-input .label input[type="radio"] {
  background-color: #202030;
  appearance: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.radio-input .label input[type="radio"]:checked {
  background-color: #435dd8;
  -webkit-animation: puls 0.7s forwards;
  animation: pulse 0.7s forwards;
}
.radio-input .label input[type="radio"]:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transition: all 0.1s cubic-bezier(0.165, 0.84, 0.44, 1);
  background-color: #fff;
  transform: scale(0);
}
.radio-input .label input[type="radio"]:checked::before {
  transform: scale(1);
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}
/* From Uiverse.io by Na3ar-17 */ 
  
/* From Uiverse.io by Admin12121 */ 
.tabs-body {
  --radius: 8px;
  --border: 4px;
  --height: 48px;
  --speed: 0.25s;
  display: grid;
  justify-content: center; /* 水平居中 */
  align-items: center; /* 垂直居中 */
  place-items: center;
  align-content: center;
  font-family: "SF Pro Text", "SF Pro Icons", "AOS Icons", "Helvetica Neue",
    Helvetica, Arial, sans-serif, system-ui;
}
.tabs {
  height: var(--height);
  display: grid;
  grid-auto-flow: column;
  background: #171717;
  border-radius: var(--radius);
  grid-auto-columns: 1fr;
  position: relative;
  border: var(--border) solid #171717;
}
.tabs {
  --ease: linear(
    0,
    0.1641 3.52%,
    0.311 7.18%,
    0.4413 10.99%,
    0.5553 14.96%,
    0.6539 19.12%,
    0.738 23.5%,
    0.8086 28.15%,
    0.8662 33.12%,
    0.9078 37.92%,
    0.9405 43.12%,
    0.965 48.84%,
    0.9821 55.28%,
    0.992 61.97%,
    0.9976 70.09%,
    1
  );
}
.tabs > .input,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
.tabs:has(:checked:nth-of-type(1)) {
  --active: 0;
}
.tabs:has(:checked:nth-of-type(2)) {
  --active: 1;
}
.tabs:has(:checked:nth-of-type(3)) {
  --active: 2;
}
.tabs:has(:checked:nth-of-type(4)) {
  --active: 3;
}
.tabs :checked + .label {
  --highlight: 1;
}
.tabs:has(.input:nth-of-type(2)) {
  --count: 2;
}
.tabs:has(.input:nth-of-type(3)) {
  --count: 3;
}
.tabs:has(.input:nth-of-type(4)) {
  --count: 4;
}
.tabs .label {
  padding: 0 clamp(10px, 10px + 10px, 20px);
  cursor: pointer;
  text-align: center;
  height: 100%;
  display: grid;
  border-radius: calc(var(--radius) - var(--border));
  place-items: center;
  color: hsl(0 0% 100% / calc(0.5 + var(--highlight, 0)));
  transition: background, color;
  transition-duration: 0.25s;
  transition-timing-function: var(--ease, ease);
}
.input:not(:checked) + .label:hover {
  --highlight: 0.35;
  background: hsl(0 0% 20%);
}
.tabs::after {
  pointer-events: none;
  content: "";
  width: calc(100% / var(--count));
  height: 100%;
  background: hsl(0 0% 100%);
  position: absolute;
  border-radius: calc(var(--radius) - var(--border));
  mix-blend-mode: difference;
  translate: calc(var(--active, 0) * 100%) 0;
  transition: translate, outline-color;
  transition-duration: var(--speed);
  transition-timing-function: var(--ease, ease);
  outline: 2px solid transparent;
}
.tabs:has(:focus-visible)::after {
  outline-color: red;
}
/* From Uiverse.io by Admin12121 */ 



/*-------------------------------------------------------*/

/* lightbox.css */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  position: relative;

  max-width: 70vw;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* 保持比例 */
  transition: transform 0.3s ease; /* 缩放动画 */
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -40px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.lightbox-close svg {
  width: 32px;
  height: 32px;
  fill: #fff;
  transition: transform 0.2s;
}

.lightbox-close:hover svg {
  transform: rotate(90deg);
}

.lightbox-loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 添加响应式调整 */
@media (max-width: 768px) {
  .lightbox-image {
    max-width: 85vw;
  }
}

/*--------------------------------------------------*/

/* lightbox.css 新增规则 */
.custom-prompt {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.prompt-content {
  background: #202020;
  padding: 2rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.prompt-content h3 {
  margin: 0 0 1.5rem 0;
  color: #ececec;
  font-size: 1.2rem;
}

.prompt-input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  background: #131313;
}

.prompt-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.btn-cancel, .btn-confirm {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-cancel {
  background: #131313;
  color: #ececec;
}

.btn-confirm {
  background: #4074FE;
  color: white;
}

.btn-cancel:hover, .btn-confirm:hover {
  opacity: 0.9;
}

/*----------------------------------------------*/

/* 基础弹窗样式 */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.dialog-content {
  background: #202020;
  padding: 2rem;
  border-radius: 8px;
  min-width: 300px;
  max-width: 90vw;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 确认对话框 */
.confirm .dialog-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* 警告提示 */
.alert {
  border-left: 4px solid #e74c3c;
}

.alert h3 {
  color: #e74c3c;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 自动提示 */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.info { background: #3498db; }
.toast.success { background: #2ecc71; }
.toast.error { background: #e74c3c; }

/* 删除按钮危险状态 */
.delete-btn {
  transition: all 0.3s ease;
  background: #f8f9fa;
  color: #dc3545;
  border: 2px solid #dc3545;
}

.delete-btn:hover {
  background: #dc3545;
  color: white;
}

/* 加载状态 */
.mini-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: currentColor;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/*-------------------------------AI-------------------------------------*/
/* 主容器布局 */
.main-content-wrapper {
  position: relative;
  height: calc(100vh - 60px); /* 扣除顶部导航高度 */
}

/* 容器切换控制 */
.search-container,
.ai-generator-container {
  display: none;
  height: 100%;
}

.search-container.active,
.ai-generator-container.active {
  display: grid;
}

/* AI绘图模式布局 */
.ai-generator-container {
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

.ai-preview-area {
  background: #161616;
  border-radius: 8px;
  padding: 20px;
}

.ai-control-panel {
  background: #161616;
  border-left: 0px solid #eee;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  
}

/* 参数控件样式 */
.style-control-group select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.range-slider {
  width: 100%;
  margin-top: 8px;
}

.prompt-input-group {
  margin-top: auto;
}

.generate-btn {
  width: 100%;
  padding: 12px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.3s;
}

.generate-btn:hover {
  background: #357abd;
}
/*任务生成中按钮样式*/
.generate-btn.generating {
  background: #e74c3c;
}

.generate-btn.generating:hover {
  background: #c0392b;
}
/* 新增AI输入框样式 */
.ai-prompt-input {
  width: 100%;
  font-size: 16px;
  padding: 12px 24px;
  border-radius: 24px;

  background: #242424;
  resize: none;
  transition: all 0.3s ease;
  min-height: 56px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: none;
  outline: none;
}

.ai-prompt-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

/* 保持与原有输入框一致的自动高度 */
.ai-prompt-input {
  overflow-y: hidden;
}

.ai-prompt-input.scroll-active {
  overflow-y: auto;
}

/* 风格卡片样式 */
.style-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.style-card {
  padding: 16px;
  border-radius: 12px;

  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  background: #242424;
}

.style-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.style-card.active {
  border-color: #007bff;
  background: #007bff;
}

.preview {
  width: 80px;
  height: 60px;
  margin: 0 auto 8px;
  border-radius: 8px;
  background-size: cover;
}

.modern-preview {
  background-image: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.nordic-preview {
  background-image: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
}

.industrial-preview {
  background-image: linear-gradient(135deg, #cfd8dc 0%, #b0bec5 100%);
}

/*-----------------------------AI模式切换--------------------*/
/* 模式切换导航 */
.mode-switch-tabs {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}
.mode-radio { display: none; }


/* 内容切换 */
.control-sections > div {
  display: none;
}
.control-sections > .active {
  display: block;
}

/* 图片上传区域 */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 150px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  cursor: pointer;
}
.upload-area:hover {
  border-color: #007bff;
}

.tabs > .mode-radio,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.tabs :checked + .mode-label {
  --highlight: 1;
}
.tabs:has(.mode-radio:nth-of-type(2)) {
  --count: 2;
}
.tabs:has(.mode-radio:nth-of-type(3)) {
  --count: 3;
}
.tabs:has(.mode-radio:nth-of-type(4)) {
  --count: 4;
}
.tabs .mode-label {
  padding: 0 clamp(10px, 10px + 10px, 20px);
  cursor: pointer;
  text-align: center;
  height: 100%;
  display: grid;
  border-radius: calc(var(--radius) - var(--border));
  place-items: center;
  color: hsl(0 0% 100% / calc(0.5 + var(--highlight, 0)));
  transition: background, color;
  transition-duration: 0.25s;
  transition-timing-function: var(--ease, ease);
}
.mode-radio:not(:checked) + .mode-label:hover {
  --highlight: 0.35;
  background: hsl(0 0% 20%);
}

/*-------------------------------------------------------------------*/
.generated-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  min-height: 100px; /* 防止高度为0 */
  align-items: flex-start;
  justify-content: flex-start;
}

.image-card {
  width: 300px;
  height: 300px;
  border-radius: 8px;
  position: relative;
  background-color: #212121;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.image-card:hover {
  transform: scale(1.02);
}

.image-card img.generated-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-card .loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.image-card .select-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: none;
}

.image-card:hover .select-overlay {
  display: block;
}
